G
G
gimade2017-04-02 18:28:35
linux
gimade, 2017-04-02 18:28:35

How to start daemons safely?

You need to start the daemon, and not just start it, but add it to startup, but it is not entirely trusted, there is a possibility that there may be something not good inside. How would you advise to run it so that it could not harm the system?
I created a separate account and group, threw the demon into the directory of this user, what to do next is not entirely clear.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eg0, 2017-04-02
@gimade

Such cases are provided by systemd.
create either in ~/.config/systemd/user/
or in /etc/system/<daemon>@user.service
file

[Unit]
Description=my daemon


[Service]
ExecStart=/usr/bin/lnav 
Restart=on-failure
SuccessExitStatus=3 4
RestartForceExitStatus=3 4

[Install]
WantedBy=default.target

and than
systemctl enable демон@myuser.service
systemctl start демон@myuser.service

I strongly advise you to read the Documentation - it is clearly written.
Z.Y. There's more
After=
Requires=

for dependency management syncthing
example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question