Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to run an IRC bot as a daemon using daemon (also tried with the daemonize utility),

I use the following command to run it,

daemon --name=HsIRCb --chdir=/var/lib/jenkins/jobs/HsIRCb/workspace --command=/var/lib/jenkins/jobs/HsIRCb/workspace/dist/build/HsIRCb/HsIRCb --pidfile=/var/lib/jenkins/jobs/HsIRCb/workspace/HsIRCb.pid

When I run the command as root, it works and the bot connects and stays there like it's supposed to, but when I ask jenkins to run it, it connects and quits immediately.

I've also tried to log in as the jenkins user, and still no dice (doesn't throw any errors).

It's worth noting that on normal users it works, it's only a problem with the user created by jenkins.

So, I'm wondering, is there some permissions that the jenkins user doesn't have, or should it be in some group or something?

share|improve this question
add comment

1 Answer

Did you try screen instead of daemon / daemonize? It is generally more featureful and tolerant of things like manipulating the shell, etc.

Try

screen -mdS HsIRCb /path/to/command

There are ways for you to do things like changing directory, logging in as a different user, etc. but this is the basic idea.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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