daemons

Start Docker Daemon as other user

老子叫甜甜 提交于 2019-12-02 04:55:51
Guys, I need to start docker daemon as other user under my Ubuntu 14.04.. I have this user in the sudoers' group and in the docker's group, but, what I need is the docker daemon running as my "test" user. test@test:/usr/bin$ start docker start: Rejected send message, 1 matched rules; type="method_call", sender=":1.88" (uid=1100 pid=24071 comm="start docker ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init ") What can I do to run docker daemon under my 'test' user without sudo? You can

Run bash script as daemon

柔情痞子 提交于 2019-11-27 06:02:17
I have a script, which runs my PHP script each X times: #!/bin/bash while true; do /usr/bin/php -f ./my-script.php echo "Waiting..." sleep 3 done How can I start it as daemon? To run it as a full daemon from a shell, you'll need to use setsid and redirect its output. You can redirect the output to a logfile, or to /dev/null to discard it. Assuming your script is called myscript.sh, use the following command: setsid myscript.sh >/dev/null 2>&1 < /dev/null & This will completely detach the process from your current shell (stdin, stdout and stderr). If you want to keep the output in a logfile,

How to make a Python script run like a service or daemon in Linux

北战南征 提交于 2019-11-26 12:37:27
I have written a Python script that checks a certain e-mail address and passes new e-mails to an external program. How can I get this script to execute 24/7, such as turning it into daemon or service in Linux. Would I also need a loop that never ends in the program, or can it be done by just having the code re executed multiple times? P Shved You have two options here. Make a proper cron job that calls your script. Cron is a common name for a GNU/Linux daemon that periodically launches scripts according to a schedule you set. You add your script into a crontab or place a symlink to it into a

How to make a Python script run like a service or daemon in Linux

微笑、不失礼 提交于 2019-11-26 03:01:37
问题 I have written a Python script that checks a certain e-mail address and passes new e-mails to an external program. How can I get this script to execute 24/7, such as turning it into daemon or service in Linux. Would I also need a loop that never ends in the program, or can it be done by just having the code re executed multiple times? 回答1: You have two options here. Make a proper cron job that calls your script. Cron is a common name for a GNU/Linux daemon that periodically launches scripts