-
-
Save alpenfritz/eca3f9b9f54fcffe997046d517fe7aed to your computer and use it in GitHub Desktop.
Revisions
-
dryliketoast created this gist
Dec 22, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ https://unix.stackexchange.com/questions/125382/migrate-socat-init-script-to-systemd For socat, I use a pure systemd approach. This is an example for a serial loopback: [Unit] Description=Socat Serial Loopback #Before=my-other.service [Service] Type=simple StandardOutput=syslog StandardError=syslog SyslogIdentifier=socat-serial-lo ExecStart=/usr/bin/socat -d -d pty,raw,echo=0,link=/tmp/seriallo-a pty,raw,echo=0,link=/tmp/seriallo-b Restart=always [Install] WantedBy=multi-user.target This can be written to /etc/systemd/system/socat-serial-lo.service (in Ubuntu 16.04+), and then: systemctl daemon-reload systemctl start socat-serial-lo systemctl enable socat-serial-lo # (to start it during bootup) One advantage of this method is that the command line defined by ExecStart can be tested directly from command line without alterations, in order to test the command. answered Sep 21 at 13:45