You are not logged in.

#1 2012-08-26 22:21:03

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 616

[solved] must I remove initscripts?

I have moved all my four Arch systems to systemd. Must I remove initscripts now? Besides "overall general" doubt I can think about /etc/rc.local on one of the installations - it hasn't nothing critical, but I don't know what is legal systemd way to execute commands after booting:

~ $ cat /etc/rc.local
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#

/usr/bin/setserial /dev/ttyS0 uart none
/sbin/modprobe lirc_serial
/usr/bin/systemctl start lircd

/usr/bin/setterm -bfreq 150
/usr/bin/setterm -blength 70

/bin/echo noop > /sys/block/sda/queue/scheduler

/bin/echo 2048 > /sys/class/rtc/rtc0/max_user_freq
/bin/echo 2048 > /proc/sys/dev/hpet/max-user-freq

Currently /etc/rc.conf hasn't not-commented out strings.

Last edited by student975 (2012-09-02 14:31:27)


"I exist" is the best myth I know..

Offline

#2 2012-08-26 22:29:41

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [solved] must I remove initscripts?

Most of this can be replaced with better solutions rather easily.

student975 wrote:
/usr/bin/setserial /dev/ttyS0 uart none

udev rule

student975 wrote:
/sbin/modprobe lirc_serial

/etc/modules-load.d

student975 wrote:
/usr/bin/systemctl start lircd

Just enable it instead of starting it? If you're having problems with this starting up earlier, it's an ordering issue which needs to be resolved somewhere.

student975 wrote:
/usr/bin/setterm -bfreq 150
/usr/bin/setterm -blength 70

I don't know what these do so I can't really comment on where they'd be appropriate.

student975 wrote:
/bin/echo noop > /sys/block/sda/queue/scheduler
/bin/echo 2048 > /sys/class/rtc/rtc0/max_user_freq
/bin/echo 2048 > /proc/sys/dev/hpet/max-user-freq

udev rule or tmpfiles.d

Offline

#3 2012-08-26 22:35:33

progandy
Member
Registered: 2012-05-17
Posts: 5,307

Re: [solved] must I remove initscripts?

If you want a pure systemd setup, you'll have to remove initscripts.
For lirc, you'll have to create a service-unit which starts a lircd wrapper. This wrapper should handle setserial, modprobe and the whole stuff the rc.d file does.
The echo-lines can be created as tmpfiles.d entries, the bell configuration maybe as service.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#4 2012-08-26 22:37:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [solved] must I remove initscripts?

I doubt those setterm commans would even do anything in rc.local.

Put them in your shell start up (eg .bashrc).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2012-08-26 22:39:17

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 616

Re: [solved] must I remove initscripts?

falconindy,

Thanks for such elaborative answer! (setterm commands just set bell's frequency and length - default ones are too sharp for me). So, if we suppose all these init details are resolved, an answer to the question about initscripts removing is big "yes", isn't it?

Last edited by student975 (2012-08-26 22:42:39)


"I exist" is the best myth I know..

Offline

#6 2012-08-26 22:40:49

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [solved] must I remove initscripts?

If the question is "must I remove initscripts" then the answer is a definite NO.

If the question is "Is there any reason to keep initscripts" then IMHO the answer is also NO.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2012-08-26 22:41:34

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 616

Re: [solved] must I remove initscripts?

Trilby wrote:

I doubt those setterm commans would even do anything in rc.local.

Yes, they don't work now.


"I exist" is the best myth I know..

Offline

#8 2012-08-26 22:42:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [solved] must I remove initscripts?

I'm surprised they ever did.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2012-08-26 22:45:22

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 616

Re: [solved] must I remove initscripts?

Trilby wrote:

I'm surprised they ever did.

To tell the truth I don't remember the way I have placed them there smile


"I exist" is the best myth I know..

Offline

#10 2012-08-27 05:00:48

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] must I remove initscripts?

FWIW, I really think that going through my rc.local file and learning how those configurations are *supposed* to be handled was actually much better for my overall understanding of which program is doing what and why.  I even made myself a rc-local.service file before actually looking at what I had in there and realizing that I could fix it correctly.

Offline

#11 2012-08-27 05:07:38

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 616

Re: [solved] must I remove initscripts?

falconindy wrote:
student975 wrote:
/usr/bin/setserial /dev/ttyS0 uart none

udev rule

Unfortunately wasn't able to find hints how to write appropriate rules. Any starting point?


"I exist" is the best myth I know..

Offline

#12 2012-08-27 05:36:54

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 616

Re: [solved] must I remove initscripts?

~ $ cat /etc/udev/rules.d/99-local.rules 

ACTION=="add", SUBSYSTEM=="tty", KERNEL=="ttyS0", RUN+="/usr/bin/setserial /dev/ttyS0 uart none"

seems to work, but I still don't understand why smile


"I exist" is the best myth I know..

Offline

#13 2012-08-27 06:22:38

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,360

Re: [solved] must I remove initscripts?

student975 wrote:
~ $ cat /etc/udev/rules.d/99-local.rules 

ACTION=="add", SUBSYSTEM=="tty", KERNEL=="ttyS0", RUN+="/usr/bin/setserial /dev/ttyS0 uart none"

seems to work, but I still don't understand why smile

Then find out, spoon-feeding is discouraged here.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#14 2012-08-27 09:53:14

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 616

Re: [solved] must I remove initscripts?

In fact,

ACTION=="add", SUBSYSTEM=="tty", KERNEL=="ttyS0", RUN+="/usr/bin/setserial /dev/ttyS0 uart none"

does work sometimes only. Probably some race conditions (with lirc_serial module loading in particular) take place. The device hasn't an appropriate attribute, so I still don't see any legal replacement for raw script (similar to commands in /etc/rc.local listed above).

As for

/bin/echo 2048 > /sys/class/rtc/rtc0/max_user_freq

this rule

ACTION=="add", SUBSYSTEM=="rtc", KERNEL=="rtc0", ATTR{max_user_freq}="2048"

does the work. But have not found a way to replace 

/bin/echo 2048 > /proc/sys/dev/hpet/max-user-freq

Direct call associated with hpet

ACTION=="add", SUBSYSTEM=="misc", KERNEL=="hpet", RUN+="/bin/echo 2048 > /proc/sys/dev/hpet/max-user-freq"

doesn't work.

ngoonee wrote:

Then find out, ...

Sorry, cannot catch an idea - I'm not native English speaker.


"I exist" is the best myth I know..

Offline

#15 2012-08-27 14:50:33

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] must I remove initscripts?

things that reside in /proc/sys can typically be handled with sysctl, there should be a file sysctl.conf so check that out.  systemd also has /etc/sysctl.d with which it handles that same directory.  check out the man pages, and you sould be just about there.

Offline

#16 2012-08-27 16:31:30

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 616

Re: [solved] must I remove initscripts?

WonderWoofy wrote:

things that reside in /proc/sys can typically be handled with sysctl, there should be a file sysctl.conf so check that out.  systemd also has /etc/sysctl.d with which it handles that same directory.  check out the man pages, and you sould be just about there.

Thanks! - It does work with sysctl.conf.

//----

As for preventing kernel to catch serial device - have tried to move own rules file name from "99-" to "30-", still have too few boots up with this renaming to judge, but it seems to be more robust smile Will report on first failing.

Last edited by student975 (2012-08-27 18:14:06)


"I exist" is the best myth I know..

Offline

#17 2012-08-27 23:43:48

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] must I remove initscripts?

So if everything seems to be working, is it solved?  If so it would be great if you could mark it as such.

Offline

#18 2012-08-28 05:43:00

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 616

Re: [solved] must I remove initscripts?

WonderWoofy wrote:

So if everything seems to be working, is it solved?  If so it would be great if you could mark it as such.

Before marking as solved I'd want to gather more successful boots up to be sure that lexical order change has resolve the issue with serial device.


"I exist" is the best myth I know..

Offline

#19 2012-08-28 17:14:02

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 616

Re: [solved] must I remove initscripts?

WonderWoofy wrote:

So if everything seems to be working, is it solved?  If so it would be great if you could mark it as such.

No, the problem with serial port isn't resolved.

Does anybody know how to explicitly order (RUN from udev rule) and (loading a module from /etc/modules-load.d/some.conf) - the second after the first?


"I exist" is the best myth I know..

Offline

#20 2012-09-02 14:31:09

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 616

Re: [solved] must I remove initscripts?

Serial port and lircing problem is resolved: https://bbs.archlinux.org/viewtopic.php?id=148200
Marking the thread solved also.


"I exist" is the best myth I know..

Offline

Board footer

Powered by FluxBB