Zirius 1 Posted July 26, 2014 Don't you guys think it would be great if we can make Hercules as Linux service? Btw, how do you guys handle autostart of Hercules after your server boot? Thanks! Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted August 3, 2014 found out one of the ways to do that is "crontab". But yeah, still resorted out to manual path configuration though. Quote Share this post Link to post Share on other sites
0 Nameless2you 97 Posted July 27, 2014 You'd have to write your own script for autorestarting it. Just do a while loop and check fi the process is still running, if not restart it, kind of thing. And it already runs on linux, so what exactly do you mean by "as linux service"? 1 Zirius reacted to this Quote Share this post Link to post Share on other sites
0 iZeal 5 Posted July 27, 2014 i think he wants it like same with: httpd, iptables, mysql so he can start it easier during boot @TS you can do that by making a crontab. 1 Zirius reacted to this Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted July 27, 2014 (edited) You'd have to write your own script for autorestarting it. Just do a while loop and check fi the process is still running, if not restart it, kind of thing. And it already runs on linux, so what exactly do you mean by "as linux service"? i think he wants it like same with: httpd, iptables, mysql so he can start it easier during boot @TS you can do that by making a crontab. Since you have control panel already installed (cPanel/Kloxo), it would be great if hercules would also autostart with mysql, apache components. Is this possible? The thing I see is making the path of hercules global, usual installation of hercules requires a non-root account whose dir goes to: /home/non-root-user, so making a script that would autostart hercules is another job for everybody I'm thinking of, since running ./configure to Hercules is inevitable in linux servers, I think it would be great if Hercules can already set it's path globally, so when you type: # service nginx start # service mysqld start # service hercules start wherever you are, the server would run. Plus, it would be very easy to add it to service: # chkconfig --add hercules # chkconfig hercules on Edited July 27, 2014 by Zirius Quote Share this post Link to post Share on other sites
0 Nameless2you 97 Posted July 27, 2014 This is a pretty decent tutorial on how to do about it: http://www.shayanderson.com/linux/add-startup-script-or-service-with-linux-on-bootup.htm 1 Zirius reacted to this Quote Share this post Link to post Share on other sites
0 Jguy 215 Posted July 28, 2014 1. Add athena-start to /etc/init.d. Rename as hercules. Adjust $PATH variable inside to point to the location of hercules. Ex: ~/home/user/hercules or /var/hercules 2. # chkconfig -add hercules 3. Reboot 4. ??? 5. Profit. You can now use service hercules start provided your user account has the ability to start the service (it should). You shouldn't have to or just plain shouldn't sudo this command, as effectively that makes your server start as root (very bad for you). 1 Zirius reacted to this Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted July 28, 2014 1. Add athena-start to /etc/init.d. Rename as hercules. Adjust $PATH variable inside to point to the location of hercules. Ex: ~/home/user/hercules or /var/hercules 2. # chkconfig -add hercules 3. Reboot 4. ??? 5. Profit. You can now use service hercules start provided your user account has the ability to start the service (it should). You shouldn't have to or just plain shouldn't sudo this command, as effectively that makes your server start as root (very bad for you). root (very bad for you) <~~ that force Hercules to run as root? Any other work around for that? Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted July 28, 2014 This is a pretty decent tutorial on how to do about it: http://www.shayanderson.com/linux/add-startup-script-or-service-with-linux-on-bootup.htm Sorry did not saw your post. Will try that and post my experience with that tut. Thanks! Quote Share this post Link to post Share on other sites
0 Nameless2you 97 Posted July 29, 2014 1. Add athena-start to /etc/init.d. Rename as hercules. Adjust $PATH variable inside to point to the location of hercules. Ex: ~/home/user/hercules or /var/hercules 2. # chkconfig -add hercules 3. Reboot 4. ??? 5. Profit. You can now use service hercules start provided your user account has the ability to start the service (it should). You shouldn't have to or just plain shouldn't sudo this command, as effectively that makes your server start as root (very bad for you). root (very bad for you) <~~ that force Hercules to run as root? Any other work around for that? Create a new user, assign the files inside the hercules directory to that specific user. Alternatively you can create a new user, create a new group, add the user to that group and change the group of the hercules directory. The commands needed for this would be: useradd, chgrp, chown, possibly also chmod. Quote Share this post Link to post Share on other sites
0 Jguy 215 Posted July 29, 2014 running service hercules start would make hercules start AS whatever user you're logged into as you run the command. if you sudo the service start then you've effectively started hercules as root (read: don't do that). Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted July 31, 2014 running service hercules start would make hercules start AS whatever user you're logged into as you run the command. if you sudo the service start then you've effectively started hercules as root (read: don't do that). yes, that's why maybe I better ask: "Autostart Hercules as non-root" Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted July 31, 2014 I think he's saying that Hercules should be started on server's machine boot, the same way it happens with Apache, MySQL, SSH and other services. Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted July 31, 2014 I think he's saying that Hercules should be started on server's machine boot, the same way it happens with Apache, MySQL, SSH and other services. Yes, but I thought they told me that doing that would make Hercules run as root? LOL. So I resort to just Make Hercules as service executed by non-root Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted July 31, 2014 I think it's possible not to run that as root on bootup, but I'm no Linux expert so wouldn't know how to make it (if actually possible). Quote Share this post Link to post Share on other sites
Don't you guys think it would be great if we can make Hercules as Linux service?
Btw, how do you guys handle autostart of Hercules after your server boot?
Thanks!
Share this post
Link to post
Share on other sites