Jump to content
  • 0
Sign in to follow this  
Zirius

Hercules as service?

Question

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

14 answers to this question

Recommended Posts

  • 0

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"?

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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 by Zirius

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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?

Share this post


Link to post
Share on other sites
  • 0

 

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.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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"

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.