socket-uart: Change to correct systemd type and revise socat pty parameters
Systemd service file Type "forking" leads to service restart which caused socket disconnection. ExecStart process was never forked. Now Type=simple fixed this issue. It' anyway recommended for long running tasks. Socat: - Fixed typo rawer to raw - Set echo off - Defined bitrate BugzID: 52063 Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
This commit is contained in:
parent
e38843c6ff
commit
dcd8b9cfb9
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh -
|
||||
if [ -x "$(command -v socat)" ]; then
|
||||
echo "start listening socket-uart services with server IP $SOCAT_SOCKET_UART_IP on port $SOCAT_SOCKET_UART_PORT"
|
||||
cmd='socat -s pty,link=/dev/ttyUM0,rawer tcp:$SOCAT_SOCKET_UART_IP:$SOCAT_SOCKET_UART_PORT'
|
||||
cmd='socat -s pty,link=/dev/ttyUM0,raw,echo=0,b115200 tcp:$SOCAT_SOCKET_UART_IP:$SOCAT_SOCKET_UART_PORT'
|
||||
|
||||
if [[ -n $SOCAT_SOCKET_UART_MSS ]]; then
|
||||
eval $cmd,mss=$SOCAT_SOCKET_UART_MSS
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Description=Bind uart socket with pseudo tty based on socat
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/socat-socket-uart
|
||||
PIDFile=/var/run/socket-uart.pid
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue