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 am trying to set my Ubuntu 13.04 machine in a way that, upon reboot, an instruction is executed and a program is launched with specific parameters, REGARDLESS of whether a user is logged on to the machine physically or by SSH.

This is the instruction that needs to be executed:

/root/ccminer/ccminer -a x11 -o stratum+tcp://drk.smartcoinpools.com:7903 -u XgZLPCQkGvvpK42jAAtgRHvs8J25xKn1XS -p picciolibeddi -q

I have modified, therefore, my /etc/rc.local as follows:

 #!/bin/sh -e
 #
 # rc.local
 #
 # This script is executed at the end of each multiuser runlevel.
 # Make sure that the script will "exit 0" on success or any other
 # value on error.
 #
 # In order to enable or disable this script just change the execution
 # bits.
 #
 # By default this script does nothing.


 /root/ccminer/ccminer -a x11 -o stratum+tcp://drk.smartcoinpools.com:7903 -u XgZLPCQkGvvpK42jAAtgRHvs8J25xKn1XS -p picciolibeddi -q

exit 0

I can't really understand why this instruction is totally ignored after rebooting, yet if I launch it manually from shell it works perfectly, so there are no errors of syntax in it.

I would appreciate it loads if you could please help me, bearing in mind that I need to run this command BEFORE any user is logged in.

share|improve this question
1  
Do you really have to start a miner with root privileges? Also, what's the problem with writing a simple upstart/systemd rule? –  Braiam Jul 21 at 14:48
1  
Try adding >/root/c.log 2>&1 to the end of that command line and see if any error messages appear in the c.log file. –  Mark Plotnick Jul 21 at 16:09

1 Answer 1

A few things:

1) Doesn't the x11 option require that the program is launched while an xserver is running?

2) Apart from this you could try cron, using the @reboot directive.

3) You might also use the screen utility to daemonize your script.

4) Further you might use sudo -u underprivileged-user ... to prevent running the program as root.

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.