Koozali.org: home of the SME Server
Obsolete Releases => SME Server 9.x => Topic started by: occasionaltable on July 27, 2016, 05:59:38 PM
-
Hello there,
I'd like to run a script at system startup as a particular user. I've tried the SME Crontab Manager, but that only allows timed jobs rather than on reboots.
I looked into using the @reboot option in the main crontab, but that only appears to default to running by the root user.
I also tried to create a crontab for that particular user using 'sudo crontab -u xxxxx', and that didn't work.
Lastly I had a quick look at /etc/init.d/functions but got a bit confused at that point.
What's the best way to do this in SME server?
Thanks!
-
Please, explain US exactly what you need, thank you
-
OK - I have a user on my system, called monitor.
When the system reboots I would like to automatically run this script:
/home/e-smith/files/users/monitor/start_server.sh
I would like it to be run by the 'monitor' user, rather than as root.
-
What is 'server'?
Is it just a script created by you or something coming with a software?
-
Hi,
It is just a script created by me. It opens up two detached 'screen' sessions both of which are running python scripts. The script works fine to do this.
This allows me to log in as the 'monitor' user and then reattach to either of the screens to check how things are running.
I know this is not the perfect way to do this, but it would be great if I could get it working for the time being.
Thanks!
-
take a look here, you can use the same approach
https://wiki.contribs.org/Tomcat
-
Thank you so, so much Stefano - that worked perfectly!
Cheers!
-
you are welcome :-)
BTW, if you find SME useful for you, would you mind to donate something? you can donate time & skills (for development, tests, bugfixing) or money :-)
TIA
-
Can this please marked [Solved]?
-
done