Skip to content

Instantly share code, notes, and snippets.

@toke
Last active June 2, 2017 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toke/5b875c642182b3520d8a2038343371ed to your computer and use it in GitHub Desktop.
Save toke/5b875c642182b3520d8a2038343371ed to your computer and use it in GitHub Desktop.
Basic hostname systemd "service"
[Unit]
Description=Hostname Socket
[Socket]
ListenStream=101
Accept=true
[Install]
WantedBy=sockets.target
[Unit]
Description=hostname service
#Requires=hostname.socket
#After=syslog.target network.target
[Service]
ExecStart=/bin/hostname -f
RemainAfterExit=no
StandardInput=socket
StandardOutput=inherit
[Install]
WantedBy=multi-user.target
Also=hostname.socket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment