Add missing systemd.socket files

Also pass the new --systemd-socket-activation to the daemons.
This commit is contained in:
Reynir Björnsson 2020-11-11 13:02:48 +01:00
parent 0508465bba
commit 0013e55d71
7 changed files with 44 additions and 6 deletions

View file

@ -8,7 +8,7 @@ After=syslog.target
[Service] [Service]
Type=simple Type=simple
User=albatross User=albatross
ExecStart=/usr/local/sbin/albatross-console --tmpdir="%t/albatross/" -vv ExecStart=/usr/local/sbin/albatross-console --systemd-socket-activation --tmpdir="%t/albatross/" -vv
RuntimeDirectoryPreserve=yes RuntimeDirectoryPreserve=yes
RuntimeDirectory=albatross RuntimeDirectory=albatross
ExecStartPre=/bin/mkdir -p %t/albatross/fifo ExecStartPre=/bin/mkdir -p %t/albatross/fifo
@ -18,4 +18,5 @@ PIDFile=%t/albatross/console.pid
RestrictAddressFamilies=AF_UNIX RestrictAddressFamilies=AF_UNIX
[Install] [Install]
Also=albatross_console.socket
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -0,0 +1,12 @@
[Unit]
Description=Albatross console socket
PartOf=albatross_console.service
[Socket]
ListenStream=%t/albatross/util/console.sock
SocketUser=albatross
#SocketMode= # FIXME: permissions
Accept=no
[Install]
WantedBy=sockets.target

View file

@ -1,6 +1,6 @@
[Unit] [Unit]
Description=Albatross VMM daemon (albatrossd) Description=Albatross VMM daemon (albatrossd)
Requires=albatross_console.service albatross_log.service Requires=albatross_console.socket albatross_log.socket
After=syslog.target albatross_console.service albatross_log.service After=syslog.target albatross_console.service albatross_log.service
[Service] [Service]
@ -8,7 +8,7 @@ Type=simple
# TODO not necessarily needs to be run as root, anything that can solo5-spt/hvt, # TODO not necessarily needs to be run as root, anything that can solo5-spt/hvt,
# create tap interfaces should be fine! # create tap interfaces should be fine!
User=root User=root
ExecStart=/usr/local/sbin/albatrossd --tmpdir="%t/albatross/" -vv ExecStart=/usr/local/sbin/albatrossd --systemd-socket-activation --tmpdir="%t/albatross/" -vv
#RuntimeDirectoryPreserve=yes #RuntimeDirectoryPreserve=yes
#RuntimeDirectory=albatross #RuntimeDirectory=albatross
PIDFile=%t/albatross/daemon.pid PIDFile=%t/albatross/daemon.pid
@ -27,4 +27,5 @@ IgnoreSIGPIPE=true
#RuntimeDirectoryMode=0700 #RuntimeDirectoryMode=0700
[Install] [Install]
Also=albatross_daemon.socket
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -0,0 +1,11 @@
[Unit]
Description=Albatross daemon socket
PartOf=albatross_daemon.service
[Socket]
ListenStream=%t/albatross/util/vmmd.sock
#SocketMode= # FIXME: permissions
Accept=no
[Install]
WantedBy=sockets.target

View file

@ -4,13 +4,13 @@
# systemctl edit albatross_log.service # systemctl edit albatross_log.service
Description=Albatross log daemon (albatross_log) Description=Albatross log daemon (albatross_log)
After=syslog.target albatross_console.service After=syslog.target albatross_console.service
Requires=albatross_console.service Requires=albatross_console.socket
[Service] [Service]
Type=simple Type=simple
User=albatross User=albatross
AssertPathExists=/var/lib/albatross/albatross.log AssertPathExists=/var/lib/albatross/albatross.log
ExecStart=/usr/local/sbin/albatross-log --logfile="/var/lib/albatross/albatross.log" --tmpdir="%t/albatross/" -vv ExecStart=/usr/local/sbin/albatross-log --systemd-socket-activation --logfile="/var/lib/albatross/albatross.log" --tmpdir="%t/albatross/" -vv
RuntimeDirectory=albatross albatross/util RuntimeDirectory=albatross albatross/util
#RuntimeDirectoryPreserve=yes # avoid albatross.log being cleaned up #RuntimeDirectoryPreserve=yes # avoid albatross.log being cleaned up
PIDFile=%t/albatross/log.pid PIDFile=%t/albatross/log.pid

View file

@ -8,11 +8,12 @@ After=syslog.target
[Service] [Service]
Type=simple Type=simple
User=albatross User=albatross
ExecStart=/usr/local/sbin/albatross-stats --tmpdir="%t/albatross/" -vv ExecStart=/usr/local/sbin/albatross-stats --systemd-socket-activation --systemd-socket-activation --tmpdir="%t/albatross/" -vv
RuntimeDirectoryPreserve=yes RuntimeDirectoryPreserve=yes
RuntimeDirectory=albatross albatross/util RuntimeDirectory=albatross albatross/util
PIDFile=%t/albatross/stat.pid PIDFile=%t/albatross/stat.pid
RestrictAddressFamilies=AF_UNIX RestrictAddressFamilies=AF_UNIX
[Install] [Install]
Also=albatross_stat.socket
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -0,0 +1,12 @@
[Unit]
Description=Albatross stats socket
PartOf=albatross_stat.service
[Socket]
ListenStream=%t/albatross/util/stat.sock
SocketUser=albatross
#SocketMode= # FIXME: permissions
Accept=no
[Install]
WantedBy=sockets.target