Skip to content

Commit

Permalink
Add systemd service for STM
Browse files Browse the repository at this point in the history
This service does not need to be enabled in the system.
It will be started automatically if a connection to one
of the listening sockets is made. System group named stm
is required for stm-user.socket to work correctly.

Change-Id: I21276d43879ef18becb49bf3fa7694bcf842ee0a
  • Loading branch information
amistewicz committed Jun 22, 2018
1 parent 60fee87 commit 3cb3d7d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sw/nanopi/stm-user.socket
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=User socket activation for STM daemon

[Socket]
SocketMode=0660
SocketGroup=stm
ListenStream=/run/stm-user.socket
Service=stm.service

[Install]
WantedBy=sockets.target
11 changes: 11 additions & 0 deletions sw/nanopi/stm.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=STM RPC
Requires=stm-user.socket
Requires=stm.socket

[Service]
ExecStart=/usr/bin/stm -serve
KillSignal=SIGINT

[Install]
WantedBy=multi-user.target
9 changes: 9 additions & 0 deletions sw/nanopi/stm.socket
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=Admin socket activation for STM daemon

[Socket]
SocketMode=0660
ListenStream=/run/stm.socket

[Install]
WantedBy=sockets.target

0 comments on commit 3cb3d7d

Please sign in to comment.