OpenBCM V1.08-5-g2f4a (Linux)

Packet Radio Mailbox

IZ3LSV

[San Dona' di P. JN]

 Login: GUEST





  
K5DAT  > PACKET   13.02.20 09:08l 65 Lines 1413 Bytes #999 (0) @ WW
BID : 21494_K5DAT
Read: GUEST
Subj: Starting linbpq from systemd
Path: IZ3LSV<ED1ZAC<GB7CIP<N7HPX<KC9VYU<W9GM<VA2OM<K5DAT
Sent: 200213/0539Z 21494@K5DAT.#CWI.WI.USA.NOAM LinBPQ6.0.19

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


 20.09.2024 12:44:35lGo back Go up