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.

Path to folder: root/CumulusServer

Command to execute: ./CumulusServer --daemon [--pidfile=/var/run/CumulusServer.pid]

I've spent considerable time trying to figure out how to modify init.d? Any help would be appreciated in resolving this issue.


Errors:

[FAILED] cd /root/CumulusServer | ./CumulusServer --daemon [--pidfile=/var/run/CumulusServer.pid] to /etc/rc.local

[FAILED] /root/CumulusServer | ./CumulusServer --daemon [--pidfile=/var/run/CumulusServer.pid] to /etc/rc.local

[FAILED] cd /root/CumulusServer && ./CumulusServer --daemon

share|improve this question

2 Answers 2

If you don't mind this command being the last thing to run at boot time, drop it into /etc/rc.local.

Note that rc.local usually contains a statement like exit 0, make sure to add your command before it so it actually runs.

For more sophisticated actions and to allow this daemon to be stopped/(re)started manually after boot, you will want to add this command to its own file under /etc/init.d as you have initially tried. Take a look at this Debian Wiki article to help you get started.

share|improve this answer
    
I'm familiar with Windows this is embarassing. What would the line be? root/CumulusServer./CumulusServer --daemon [--pidfile=/var/run/CumulusServer.pid] in one single line before exit 0? –  user65922 Apr 23 '14 at 1:23
    
I tried the two examples above (see my edited post any help would be appreciated) –  user65922 Apr 23 '14 at 1:38

Disregard cd, | and &&. You just need to use the absolute(full) path to the CumulusServer file you're trying to execute. Additionally, you can remove the brackets [ ] from the --pidfile option. When showing examples of a program's command line syntax, brackets denote an optional section of the command and they aren't actually used.

This will insert your command into rc.local, above exit 0:

$ sudo sed -i '/^exit/ i\/root/CumulusServer/CumulusServer --daemon --pidfile=/var/run/CumulusServer.pid\' /etc/rc.local
share|improve this answer

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.