Hercules as service?

Zirius

New member
Messages
261
Points
0
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!

 
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.

 
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

 
Last edited by a moderator:
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. 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?

 
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.

 
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).

 
Last edited by a moderator:
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"

 
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.

 
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

 
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).

 
found out one of the ways to do that is "crontab". But yeah, still resorted out to manual path configuration though.

 
Back
Top