Skip to content

Instantly share code, notes, and snippets.

@sebastianhaas
Created August 6, 2016 15:02
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save sebastianhaas/f134398df1c710fcb8eaf297f49d33d4 to your computer and use it in GitHub Desktop.
Save sebastianhaas/f134398df1c710fcb8eaf297f49d33d4 to your computer and use it in GitHub Desktop.
An example systemd unit file to setup a SocketCAN interface on startup
[Unit]
Description=SocketCAN interface can0 with a baudrate of 250000
After=multi-user.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip link set can0 type can bitrate 250000 ; /sbin/ifconfig can0 up
ExecReload=/sbin/ifconfig can0 down ; /sbin/ip link set can0 type can bitrate 250000 ; /sbin/ifconfig can0 up
ExecStop=/sbin/ifconfig can0 down
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment