|
K5DAT > PACKET 01.03.20 23:26l 72 Lines 1749 Bytes #999 (0) @ WW
BID : 21494_K5DAT
Read: GUEST
Subj: Starting linbpq from systemd
Path: IW8PGT<HB9ON<IW2OHX<IR1UAW<I0OJJ<I0OJJ<N6RME<AA6HF<N3HYM<KC9VYU<
W9GM<VA2OM<K5DAT
Sent: 200213/0539Z 21494@K5DAT.#CWI.WI.USA.NOAM LinBPQ6.0.19
>From k5dat%k5dat.#cwi.wi.usa.noam@i0ojj.ampr.org Thu Feb 13 07:00:20 2020
Received: from i0ojj.ampr.org by i0ojj.ampr.org (JNOS2.0m.1) with SMTP
id AA99379 ; Thu, 13 Feb 2020 07:00:20 +0100
Message-Id: <21494_K5DAT@i0ojj.bbs>
>From: k5dat@k5dat.#cwi.wi.usa.noam
X-JNOS-User-Port: Telnet (i0ojj @ 44.134.32.240) -> Sending message
Actually starting linbpq (or any application) via systemd as
a non-root user can be done within the systemd service.
(Create a text file named linbpq.service in /etc/systemd/system)
The contents of linbpq.service would look like this if
the user and primary group are bpq. Adjust user, group
and path to linbpq executable as needed.
[Unit]
After=network.target
[Service]
User=bpq
Group=bpq
ExecStart=/home/bpq/linbpq
Restart=always
[Install]
WantedBy=multi-user.target
After creating the linbpq.service file, issue these commands as was noted before:
sudo systemctl daemon-reload
sudo systemctl enable linbpq.service
The second one will result in starting linbpq at bootup.
I run linbpq under screen, so my linbpq.service file looks like this:
Note my user and group are lee, and the path is different - so modify
as necessary.
[Unit]
Description=BPQ
After=network.target
[Service]
Type=forking
WorkingDirectory=/home/lee/BPQ
User=lee
Group=lee
ExecStart=/usr/bin/screen -S bpq -d -m /home/lee/BPQ/linbpq
SyslogIdentifier=BPQ
[Install]
WantedBy=multi-user.target
The above runs linbpq in a detached screen session named bpq.
To attach to the session, issue...
screen -r bpq
Attaching to the session allows you to see whether or not BPQ started properly.
To detach, issue...
Ctrl-a d
You might need to install screen - (sudo apt-get install screen)
if Debian/Raspian or Ubuntu.
73,
Lee K5DAT
Read previous mail | Read next mail
| |