A
A
alegkonin2020-10-30 14:09:29
Debian
alegkonin, 2020-10-30 14:09:29

Auto start target in systemd?

Good afternoon, colleagues, I ask you to help with the solution of the issue. There are some units, they start on their own, but there are also those that cannot, for example:

#[email protected]
Description=RQ Worker Number %i
After=network.target

[Service]
Type=simple
WorkingDirectory=/var/www/public/eis_bot
Environment=LANG=en_US.UTF-8
Environment=LC_ALL=en_US.UTF-8
Environment=LC_LANG=en_US.UTF-8
ExecStart=/root/.pyenv/shims/rq worker handler
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
Restart=always

[Install]
WantedBy=multi-user.target

Registered target for it:
[Unit]
Description=Working for eis_bot target
[email protected]
[email protected]
<...>
After=network.target


But it does not start after server reboot.
The question is how to make it start automit? Thanks in advance and sorry if this is a dumb question

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alegkonin, 2020-10-30
@alegkonin

Issue resolved.
forgot to add to target

[Install]
WantedBy=multi-user.target

and turn it on.
Also in .service it was necessary to change WantedBy to your target and create symlinks for it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question