Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have created a symlink to a start/stop/etc. wrapper bash script in /etc/rc.d, added it to DAEMONS=() in rc.conf, but the process it points to isn’t starting on boot, and isn’t showing up in the output of $ rc.d list. Googling around, I have seen mention of update-rc.d, but it seems that command is not available in Arch Linux. What is the right way of adding a system-wide daemon (i.e., without using rc.local) that can be used the same way as the defaults?

share|improve this question
1  
Did you mark the scripts executable? –  lynxlynxlynx Jul 17 '12 at 6:21
    
The ArchWiki explains Arch Linux' boot process in detail, rc.multi takes care of DAEMONS. –  sr_ Jul 17 '12 at 6:29
add comment

1 Answer

What does update-rc.d to do with Arch ? that's for debian based distros.

A sample script, put it in /etc/rc.d/XX and make it executable, and edit /etc/rc.conf, push the name of the service into DAEMONS array

#!/bin/sh

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
        stop)
                stat_busy "Stopping XX"
                command_to_exec && rm_daemon XX && stat_done || stat_fail
                ;;
        start)
                stat_busy "Starting XXX"
                command_to_exec && add_daemon XX && stat_done || stat_fail
                ;;

esac

exit 0

If you're not seeing the daemon in list, you've probably missed the add_daemon function

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.