Autostart/restart program simply with daemontools in debian 9
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
For example make vlc start and play a video full screen on boot. After working this out here it is:
debian daemon daemontools
add a comment |Â
up vote
1
down vote
favorite
For example make vlc start and play a video full screen on boot. After working this out here it is:
debian daemon daemontools
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
For example make vlc start and play a video full screen on boot. After working this out here it is:
debian daemon daemontools
For example make vlc start and play a video full screen on boot. After working this out here it is:
debian daemon daemontools
asked Apr 2 at 20:31
Hayden Thring
1216
1216
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
You first need the following 2 packages if not already:
apt-get install daemontools daemontools-run
This will install and get running the needed "monitors",
Then you need to create the "shortcut" to your program to start/restart automatically:
mkdir /home/user/vlc-daemon /home/user/vlc-daemon/log /home/user/vlc-daemon/log/main
gedit /home/user/vlc-daemon/run
put in this file and save it:
#!/bin/sh
echo starting vlc-d
export DISPLAY=:0 #needed for X program
exec setuidgid user /usr/bin/vlc -f /home/user/Downloads/myvideo.avi
This starts vlc program in fullscreen playing myvideo.avi as user "user" , adapt as needed.
Then, for logging: (add and save)
gedit /home/user/vlc-daemon/log/run
#!/bin/sh
exec setuidgid user multilog t ./main
Make them executable:
chmod 755 /home/user/vlc-daemon/run /home/user vlc-daemon/log/run
Now to install & activate service:
update-service --add /home/user/vlc-daemon
Now your program should be running, and start/restart automatically. for more documentation see: http://cr.yp.to/daemontools.html
If not check log/main folder, and that you can also run /home/user/vlc-daemon/run manually from cli , also the following command can show some errors:
ps -aux | grep readproctitle
Although good security practice is not to put system-level services in directories that unprivileged users have control over. Better practice would be to have a per-user instance ofsvscan
running as the unprivileged user to start with; but that is more work and more complex than this. As is handlingDISPLAY
in a robust fashion.
â JdeBP
Apr 2 at 20:49
Well that is the way debian supplies it (svscan)?, One change i think i do need to make is delay app initial startup until later if possible, to allow more time for wifi to come up. Should i edit it and put the daemon outside home ?
â Hayden Thring
Apr 2 at 20:53
The thing to remember is that it is a toolset. You are not limited to just doing only a few things with it, and running an unprivilegedsvscan
out of, say,$HOME/.config/service
is after all just a matter of another service tosetuidgid
and do so.
â JdeBP
Apr 2 at 21:02
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You first need the following 2 packages if not already:
apt-get install daemontools daemontools-run
This will install and get running the needed "monitors",
Then you need to create the "shortcut" to your program to start/restart automatically:
mkdir /home/user/vlc-daemon /home/user/vlc-daemon/log /home/user/vlc-daemon/log/main
gedit /home/user/vlc-daemon/run
put in this file and save it:
#!/bin/sh
echo starting vlc-d
export DISPLAY=:0 #needed for X program
exec setuidgid user /usr/bin/vlc -f /home/user/Downloads/myvideo.avi
This starts vlc program in fullscreen playing myvideo.avi as user "user" , adapt as needed.
Then, for logging: (add and save)
gedit /home/user/vlc-daemon/log/run
#!/bin/sh
exec setuidgid user multilog t ./main
Make them executable:
chmod 755 /home/user/vlc-daemon/run /home/user vlc-daemon/log/run
Now to install & activate service:
update-service --add /home/user/vlc-daemon
Now your program should be running, and start/restart automatically. for more documentation see: http://cr.yp.to/daemontools.html
If not check log/main folder, and that you can also run /home/user/vlc-daemon/run manually from cli , also the following command can show some errors:
ps -aux | grep readproctitle
Although good security practice is not to put system-level services in directories that unprivileged users have control over. Better practice would be to have a per-user instance ofsvscan
running as the unprivileged user to start with; but that is more work and more complex than this. As is handlingDISPLAY
in a robust fashion.
â JdeBP
Apr 2 at 20:49
Well that is the way debian supplies it (svscan)?, One change i think i do need to make is delay app initial startup until later if possible, to allow more time for wifi to come up. Should i edit it and put the daemon outside home ?
â Hayden Thring
Apr 2 at 20:53
The thing to remember is that it is a toolset. You are not limited to just doing only a few things with it, and running an unprivilegedsvscan
out of, say,$HOME/.config/service
is after all just a matter of another service tosetuidgid
and do so.
â JdeBP
Apr 2 at 21:02
add a comment |Â
up vote
1
down vote
You first need the following 2 packages if not already:
apt-get install daemontools daemontools-run
This will install and get running the needed "monitors",
Then you need to create the "shortcut" to your program to start/restart automatically:
mkdir /home/user/vlc-daemon /home/user/vlc-daemon/log /home/user/vlc-daemon/log/main
gedit /home/user/vlc-daemon/run
put in this file and save it:
#!/bin/sh
echo starting vlc-d
export DISPLAY=:0 #needed for X program
exec setuidgid user /usr/bin/vlc -f /home/user/Downloads/myvideo.avi
This starts vlc program in fullscreen playing myvideo.avi as user "user" , adapt as needed.
Then, for logging: (add and save)
gedit /home/user/vlc-daemon/log/run
#!/bin/sh
exec setuidgid user multilog t ./main
Make them executable:
chmod 755 /home/user/vlc-daemon/run /home/user vlc-daemon/log/run
Now to install & activate service:
update-service --add /home/user/vlc-daemon
Now your program should be running, and start/restart automatically. for more documentation see: http://cr.yp.to/daemontools.html
If not check log/main folder, and that you can also run /home/user/vlc-daemon/run manually from cli , also the following command can show some errors:
ps -aux | grep readproctitle
Although good security practice is not to put system-level services in directories that unprivileged users have control over. Better practice would be to have a per-user instance ofsvscan
running as the unprivileged user to start with; but that is more work and more complex than this. As is handlingDISPLAY
in a robust fashion.
â JdeBP
Apr 2 at 20:49
Well that is the way debian supplies it (svscan)?, One change i think i do need to make is delay app initial startup until later if possible, to allow more time for wifi to come up. Should i edit it and put the daemon outside home ?
â Hayden Thring
Apr 2 at 20:53
The thing to remember is that it is a toolset. You are not limited to just doing only a few things with it, and running an unprivilegedsvscan
out of, say,$HOME/.config/service
is after all just a matter of another service tosetuidgid
and do so.
â JdeBP
Apr 2 at 21:02
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You first need the following 2 packages if not already:
apt-get install daemontools daemontools-run
This will install and get running the needed "monitors",
Then you need to create the "shortcut" to your program to start/restart automatically:
mkdir /home/user/vlc-daemon /home/user/vlc-daemon/log /home/user/vlc-daemon/log/main
gedit /home/user/vlc-daemon/run
put in this file and save it:
#!/bin/sh
echo starting vlc-d
export DISPLAY=:0 #needed for X program
exec setuidgid user /usr/bin/vlc -f /home/user/Downloads/myvideo.avi
This starts vlc program in fullscreen playing myvideo.avi as user "user" , adapt as needed.
Then, for logging: (add and save)
gedit /home/user/vlc-daemon/log/run
#!/bin/sh
exec setuidgid user multilog t ./main
Make them executable:
chmod 755 /home/user/vlc-daemon/run /home/user vlc-daemon/log/run
Now to install & activate service:
update-service --add /home/user/vlc-daemon
Now your program should be running, and start/restart automatically. for more documentation see: http://cr.yp.to/daemontools.html
If not check log/main folder, and that you can also run /home/user/vlc-daemon/run manually from cli , also the following command can show some errors:
ps -aux | grep readproctitle
You first need the following 2 packages if not already:
apt-get install daemontools daemontools-run
This will install and get running the needed "monitors",
Then you need to create the "shortcut" to your program to start/restart automatically:
mkdir /home/user/vlc-daemon /home/user/vlc-daemon/log /home/user/vlc-daemon/log/main
gedit /home/user/vlc-daemon/run
put in this file and save it:
#!/bin/sh
echo starting vlc-d
export DISPLAY=:0 #needed for X program
exec setuidgid user /usr/bin/vlc -f /home/user/Downloads/myvideo.avi
This starts vlc program in fullscreen playing myvideo.avi as user "user" , adapt as needed.
Then, for logging: (add and save)
gedit /home/user/vlc-daemon/log/run
#!/bin/sh
exec setuidgid user multilog t ./main
Make them executable:
chmod 755 /home/user/vlc-daemon/run /home/user vlc-daemon/log/run
Now to install & activate service:
update-service --add /home/user/vlc-daemon
Now your program should be running, and start/restart automatically. for more documentation see: http://cr.yp.to/daemontools.html
If not check log/main folder, and that you can also run /home/user/vlc-daemon/run manually from cli , also the following command can show some errors:
ps -aux | grep readproctitle
answered Apr 2 at 20:31
Hayden Thring
1216
1216
Although good security practice is not to put system-level services in directories that unprivileged users have control over. Better practice would be to have a per-user instance ofsvscan
running as the unprivileged user to start with; but that is more work and more complex than this. As is handlingDISPLAY
in a robust fashion.
â JdeBP
Apr 2 at 20:49
Well that is the way debian supplies it (svscan)?, One change i think i do need to make is delay app initial startup until later if possible, to allow more time for wifi to come up. Should i edit it and put the daemon outside home ?
â Hayden Thring
Apr 2 at 20:53
The thing to remember is that it is a toolset. You are not limited to just doing only a few things with it, and running an unprivilegedsvscan
out of, say,$HOME/.config/service
is after all just a matter of another service tosetuidgid
and do so.
â JdeBP
Apr 2 at 21:02
add a comment |Â
Although good security practice is not to put system-level services in directories that unprivileged users have control over. Better practice would be to have a per-user instance ofsvscan
running as the unprivileged user to start with; but that is more work and more complex than this. As is handlingDISPLAY
in a robust fashion.
â JdeBP
Apr 2 at 20:49
Well that is the way debian supplies it (svscan)?, One change i think i do need to make is delay app initial startup until later if possible, to allow more time for wifi to come up. Should i edit it and put the daemon outside home ?
â Hayden Thring
Apr 2 at 20:53
The thing to remember is that it is a toolset. You are not limited to just doing only a few things with it, and running an unprivilegedsvscan
out of, say,$HOME/.config/service
is after all just a matter of another service tosetuidgid
and do so.
â JdeBP
Apr 2 at 21:02
Although good security practice is not to put system-level services in directories that unprivileged users have control over. Better practice would be to have a per-user instance of
svscan
running as the unprivileged user to start with; but that is more work and more complex than this. As is handling DISPLAY
in a robust fashion.â JdeBP
Apr 2 at 20:49
Although good security practice is not to put system-level services in directories that unprivileged users have control over. Better practice would be to have a per-user instance of
svscan
running as the unprivileged user to start with; but that is more work and more complex than this. As is handling DISPLAY
in a robust fashion.â JdeBP
Apr 2 at 20:49
Well that is the way debian supplies it (svscan)?, One change i think i do need to make is delay app initial startup until later if possible, to allow more time for wifi to come up. Should i edit it and put the daemon outside home ?
â Hayden Thring
Apr 2 at 20:53
Well that is the way debian supplies it (svscan)?, One change i think i do need to make is delay app initial startup until later if possible, to allow more time for wifi to come up. Should i edit it and put the daemon outside home ?
â Hayden Thring
Apr 2 at 20:53
The thing to remember is that it is a toolset. You are not limited to just doing only a few things with it, and running an unprivileged
svscan
out of, say, $HOME/.config/service
is after all just a matter of another service to setuidgid
and do so.â JdeBP
Apr 2 at 21:02
The thing to remember is that it is a toolset. You are not limited to just doing only a few things with it, and running an unprivileged
svscan
out of, say, $HOME/.config/service
is after all just a matter of another service to setuidgid
and do so.â JdeBP
Apr 2 at 21:02
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f435127%2fautostart-restart-program-simply-with-daemontools-in-debian-9%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password