Forum › Forums › New users › New Users and General Questions › links to init.d scripts
- This topic has 2 replies, 2 voices, and was last updated Nov 25-5:09 pm by Vincent17.
-
AuthorPosts
-
November 24, 2020 at 6:10 pm #45683Member
Vincent17
Dealing with a poweroff problem, I looked into /etc/rc0.d: it has about 20 links to scripts in init.d, which I assume do the necessary tasks before turning the computer off. But some of the linked scripts (includng halt) have a “case $1 in” statement which fails if $1=””. So how do those links in rc0.d work?
$> /etc/rc0.d/K12halt Usage: /etc/rc0.d/K12halt start|stop $>Thanks!
antiX-17.4.1_386-base
- This topic was modified 2 years, 5 months ago by Vincent17.
- This topic was modified 2 years, 5 months ago by Vincent17.
November 24, 2020 at 10:34 pm #45696Anonymous
::For a fuller explanation than what I can type here, websearch “linux inittab”
Afterwards, if you post back to recommend one, or a few, particularly useful articles
we should include hyperlinks to them in the wiki.man sysv-rc-conf
sudo sysv-rc-conf
This utility enables you to toggle on/off specify each of the various services which you want to autorun upon entering each of the runlevels. It handles writing/rewriting the links seen in the /etc/rc*.d directoriesEach scripted item, is started (or killed) in numerical order.
For an inittab item “40bumpyscript”, if it’s slated to autostart upon entering runlevel 2
we would see presence of a link /etc/rc2.d/S40bumpyscript.
If it is slated to be killed (if running) upon entering runlevel2,
we would instead see a link /etc/rc2.d/K40bumpyscript.The numeric prefixes steer the relative loading order. If 30something and 40 something are already used by existing (perhaps preinstalled, or autoinstalled) items, and you want to add a new item “bumpyscript” and have it autostarted “after the 30item but prior to the 40item“, you might name it “36bumpyscript”.
Debian, and antiX, default configuration is setup to operate runlevels 0-6, and S.
(and, IIRC, antiX runlevels 2 and 5, per stock configuration bear identical config items)If needed (why? idunno) or if desirable, you can freely specify additional runlevels.
If you do, check the sysv-rc-conf manpage; that utility is limited to displaying only XX columns (if there are too many to fit, you can choose which runlevel columns should be displayed).November 25, 2020 at 5:09 pm #45767MemberVincent17
::For a fuller explanation than what I can type here, websearch “linux inittab”
skidoo, thank you for sending me in the right direction. I have a lot of background to acquire before I’ll be in a position to recommend a tutorial, but I found the answer to my immediate question. The links in rc#.d are not executed directly, they are executed by the script init.d/rc, which supplies “start” or “stop” as appropriate.
-
AuthorPosts
- You must be logged in to reply to this topic.