1

My current setup consists of Ubuntu VPS 14.04 x64 Bit. I've got two users; 'root' and 'mcmyadmin'. I'm trying to automatically run the McMyAdmin software every time my VPS reboots.

This is the command, and I'm attempting to run it from the user 'mcmyadmin' at startup:

cd ~/McMyAdmin; screen ./MCMA2_Linux_x86_64

I've got this reflected in the /etc/rc.local file, which I've seen from other SE threads, should cause this command to be run after boot has finished.

This is my /etc/rc.local file:

#!/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.
cd ~/McMyAdmin; screen ./MCMA2_Linux_x86_64
exit 0

I've tried changing the owner of this file with chown, so 'root' is the owner, but this didn't make any difference; whenever I reboot my server it doesn't run this command.

If you could provide any insight into what's going wrong here, that would be greatly appreciated!

1

Try full path to home dir : cd /home/mcmyadmin/McMyAdmin and use su to run this script from another user (not root).

  • Thank you very much! The following worked for me: cd /home/mcmyadmin/McMyAdmin; screen ./MCMA2_Linux_x86_64. It was obviously just the relative path that was the problem; writing out the full location fixed my problem. – Ed Everett Feb 19 '15 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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