Skip to content

Instantly share code, notes, and snippets.

@larsks
Created February 22, 2013 00:45
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larsks/5009872 to your computer and use it in GitHub Desktop.
Save larsks/5009872 to your computer and use it in GitHub Desktop.
A systemd unit for ucarp. This is a templated service; call it like `systemctl start ucarp@001` to start up ucarp using `/etc/ucarp/vip-001.conf`.
[Unit]
Description=UCARP virtual interface %I
After=network.target
[Service]
Type=simple
EnvironmentFile=-/etc/ucarp/vip-common.conf
EnvironmentFile=-/etc/ucarp/vip-%I.conf
ExecStart=/usr/sbin/ucarp -i $BIND_INTERFACE -p $PASSWORD -v %I -a $VIP_ADDRESS -s $SOURCE_ADDRESS $OPTIONS -u $UPSCRIPT -d $DOWNSCRIPT
KillMode=control-group
[Install]
WantedBy=multiuser.target
@gzjon
Copy link

gzjon commented Sep 12, 2016

I had to set Type=forking to keep it working
debian 8.5
ucarp 1.5.2-2

@devZer0
Copy link

devZer0 commented Apr 21, 2017

i'm curious why ucarp systemd template on centos7 (installed ucarp from epel) looks like this:

# rpm -q -a |grep ucarp
ucarp-1.5.2-11.el7.x86_64

# cat /usr/lib/systemd/system/ucarp@.service
[Unit]
Description=Common address redundancy protocol daemon on %I
After=syslog.target network.target

[Service]
PrivateTmp=true
Type=forking
ExecStart=/usr/libexec/ucarp/ucarp

[Install]
WantedBy=multi-user.target`

IMHO, your template looks more correct, the one from the official package looks wrong to me as every instance created just makes the unit description be different but imho cannot start another individual ucarp instance.

doesn`t it ?

regards
roland

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment