LinHES Forums
http://forums.linhes.org/

How to Add a Simple Bash Script to Run at Startup in LinHES?
http://forums.linhes.org/viewtopic.php?f=21&t=21847
Page 1 of 1

Author:  tzoom84 [ Sat Oct 23, 2010 11:13 am ]
Post subject:  How to Add a Simple Bash Script to Run at Startup in LinHES?

Hi all,

I recently upgraded from R5.5 to LinHES 6.03 last night, and have a few questions.

(1)

I have a simple bash script/daemon that has the old standard start/stop/restart options within in. Back in the knoppmyth days I would just put this into /etc/init.d, and run update-rc.d on it. However, I can't seem to find the right place/commands for LinHES (Arch).

Looking here, I assumed I could use add_service.sh. But it seems that the script needs to be in a new format: a directory in /etc/sv, with sub-scripts like "run", "finish", etc, within that directory.

I'd really prefer to keep the original script as-is, and not have to parse it into these sub scripts that have new calls (like stat_runit). Is there any way to add just a single script/daemon to the startup routine?

(2)

I am also confused as to which is called on startup, /etc/sv OR /etc/rc.d (or both?). I noticed some programs, like sshd, live in BOTH directories but have different commands. As in, /etc/rc.d/sshd is different from /etc/sv/sshd/run. Which is used?


Thanks for helping me clarify this new procedure. Guess I am far too used to the "old ways"

Author:  mattbatt [ Sat Oct 23, 2010 12:34 pm ]
Post subject: 

there is a built in option for quit reboot and shutdown of the computer. Are you talking about starting and stopping the backend?

Author:  tzoom84 [ Sat Oct 23, 2010 12:36 pm ]
Post subject: 

The script isn't to start/stop/restart the computer, it is to start/stop/restart the program.

For example, /etc/rc.d/sshd has a "start/stop" command in it. But I'm not sure where sshd is called upon startup, /etc/rc.d, or /etc/sv.

But even the start/stop/restart aside, I'm trying to figure out how to turn a standard bash script/daemon into something that boots on startup in linhes. It seems it "add_service.sh" can only be used on things that conform to the directory structure found under /etc/sv.

Author:  mattbatt [ Wed Oct 27, 2010 7:35 pm ]
Post subject: 

yep over my head
bumped

Author:  christ [ Wed Oct 27, 2010 8:07 pm ]
Post subject: 

The system boot is controlled by "runit". For more detail, try:
Code:
man runit

I haven't done this on LinHES yet (not had a need) but if you look in /etc/runit you will see stages 1, 2, and 3 per man. Looking at Stage 1 script it calls "1.local" which is where you apparently add your own scripts.

worth a try!

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/