use systemd socket activation (#909563)

This commit is contained in:
Miroslav Lichvar 2013-12-02 19:59:42 +01:00
parent 3929e176b5
commit 0f0aab2aab
3 changed files with 9 additions and 4 deletions

View File

@ -5,7 +5,8 @@ After=chronyd.service
[Service]
EnvironmentFile=-/etc/sysconfig/gpsd
ExecStart=/usr/sbin/gpsd -F /var/run/gpsd.sock -N $OPTIONS $DEVICE
ExecStart=/usr/sbin/gpsd -N $OPTIONS
[Install]
WantedBy=multi-user.target
Also=gpsd.socket

View File

@ -118,6 +118,8 @@ DESTDIR=%{buildroot} scons install
%{__install} -d -m 0755 %{buildroot}%{_unitdir}
%{__install} -p -m 0644 %{SOURCE10} \
%{buildroot}%{_unitdir}/gpsd.service
%{__install} -p -m 0644 systemd/gpsd.socket \
%{buildroot}%{_unitdir}/gpsd.socket
%{__install} -d -m 0755 %{buildroot}%{_sysconfdir}/sysconfig
%{__install} -p -m 0644 %{SOURCE11} \
@ -163,10 +165,10 @@ do
done
%post
%systemd_post gpsd.service
%systemd_post gpsd.service gpsd.socket
%preun
%systemd_preun gpsd.service
%systemd_preun gpsd.service gpsd.socket
%postun
# Don't restart the service
@ -186,6 +188,7 @@ done
%{_bindir}/gpsmon
%{_bindir}/gpsctl
%{_unitdir}/gpsd.service
%{_unitdir}/gpsd.socket
%{_udevrulesdir}/*.rules
%{_prefix}/lib/udev/gpsd*
%{_mandir}/man8/gpsd.8*

View File

@ -1,3 +1,4 @@
# Options for gpsd, including serial devices
OPTIONS=""
DEVICE="/dev/ttyUSB0"
# Set to 'true' to add USB devices automatically via udev
USBAUTO="true"