Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
An example systemd template unit file to setup a SocketCAN interface on startup
[Unit]
Description=SocketCAN interface %i with a baudrate of 500000
After=multi-user.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip link set %i type can bitrate 500000 ; /sbin/ifconfig %i up
ExecReload=/sbin/ifconfig %i down ; /sbin/ip link set %i type can bitrate 500000 ; /sbin/ifconfig %i up
ExecStop=/sbin/ifconfig %i down
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment