The officially official Devuan Forum!

You are not logged in.

#1 2018-04-03 02:49:58

GNUser
Member
Registered: 2017-03-16
Posts: 570  

trying to understand basics of SysVinit scripts [SOLVED]

This is a super basic exercise that has me stumped. Please help and pardon my ignorance.

1. I created /etc/init.d/test with this in it:

#!/bin/sh

touch /home/bruno/Desktop/hello

Then I made the script executable.

2. I ran this command: sudo ln -s /etc/init.d/test /etc/rc2.d/S09test

3. I reboot the system.

The script does not appear to run (i.e., a file named "hello" does not show up on my desktop). What am I missing?

P.S. I do not want to use LSB headers or the update-rc.d command. I can get things to work that way, but for this exercise I want to do things manually and as simply as possible so that I can understand the absolute bare essentials.

Last edited by GNUser (2018-04-03 13:00:42)

Offline

#2 2018-04-03 04:07:24

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,252  

Re: trying to understand basics of SysVinit scripts [SOLVED]

You'll probably do need to understand insserv, which is the one using the LSB headers, and manipulating the files /etc/init.d/.depend.{boot,start,stop}, which are the "make files" for the init process. I'm not totally sure where/when/how init uses those files, but as I remember it, those files tell which scripts to run when. The insserv man page points at startpar as the actual driver process, so I guess, all together it's init, insserv and startpar to peruse.

Online

#3 2018-04-03 12:46:24

GNUser
Member
Registered: 2017-03-16
Posts: 570  

Re: trying to understand basics of SysVinit scripts [SOLVED]

Thank you, ralph.ronnquist. I guess nothing is ever as simple as it seems.

I will learn about insserv and friends, and will experiment with the hidden files. I have a full partition backup, so I can tinker with abandon.

I'll update the thread if there is a simple solution to my little exercise. If it's too complicated, it kind of defeats the purpose.

Offline

#4 2018-04-03 13:00:05

GNUser
Member
Registered: 2017-03-16
Posts: 570  

Re: trying to understand basics of SysVinit scripts [SOLVED]

The missing step was to add test to the end of the TARGETS list at the top of /etc/init.d/.depend.start

At this point I don't understand why it worked, but am happy to be one step closer to understanding.

Thanks again!

Offline

Board footer