Add a systemd packagekit.service file
We're still bus-activated by default, but now the system bus will ask systemd to start us. There are numerous advantages to this model, among them the ability to use the far more powerful systemd unit config file for controlling service parameters. Personally I like just having "systemctl status packagekit" work. Signed-off-by: Richard Hughes <richard@hughsie.com>
This commit is contained in:
parent
c0fa2592d0
commit
f40b70e7e7
@ -278,6 +278,8 @@ AM_CONDITIONAL(PK_BUILD_SYSTEMD, test x$enable_systemd = xyes)
|
|||||||
if test x$enable_systemd = xyes; then
|
if test x$enable_systemd = xyes; then
|
||||||
PKG_CHECK_MODULES(SYSTEMD, libsystemd-login)
|
PKG_CHECK_MODULES(SYSTEMD, libsystemd-login)
|
||||||
AC_DEFINE(PK_BUILD_SYSTEMD,1,[Build systemd code])
|
AC_DEFINE(PK_BUILD_SYSTEMD,1,[Build systemd code])
|
||||||
|
with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
|
||||||
|
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl ---------------------------------------------------------------------------
|
dnl ---------------------------------------------------------------------------
|
||||||
|
@ -341,6 +341,7 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
|
|||||||
%{_libdir}/girepository-1.0/PackageKitPlugin-1.0.typelib
|
%{_libdir}/girepository-1.0/PackageKitPlugin-1.0.typelib
|
||||||
%{_datadir}/dbus-1/interfaces/*.xml
|
%{_datadir}/dbus-1/interfaces/*.xml
|
||||||
/usr/lib/systemd/system/packagekit-offline-update.service
|
/usr/lib/systemd/system/packagekit-offline-update.service
|
||||||
|
/usr/lib/systemd/system/packagekit.service
|
||||||
%{_libexecdir}/pk-*offline-update
|
%{_libexecdir}/pk-*offline-update
|
||||||
|
|
||||||
%files docs
|
%files docs
|
||||||
|
@ -30,6 +30,16 @@ servicemain_DATA = $(servicemain_in_files:.service.in=.service)
|
|||||||
$(servicemain_DATA): $(servicemain_in_files) Makefile
|
$(servicemain_DATA): $(servicemain_in_files) Makefile
|
||||||
@sed -e "s|\@servicedir\@|$(libexecdir)|" -e "s|\@PACKAGEKIT_USER\@|$(PACKAGEKIT_USER)|" $< > $@
|
@sed -e "s|\@servicedir\@|$(libexecdir)|" -e "s|\@PACKAGEKIT_USER\@|$(PACKAGEKIT_USER)|" $< > $@
|
||||||
|
|
||||||
|
systemdservice_in_files = packagekit.service.in
|
||||||
|
|
||||||
|
if PK_BUILD_SYSTEMD
|
||||||
|
systemdservicedir = $(systemdsystemunitdir)
|
||||||
|
systemdservice_DATA = $(systemdservice_in_files:.service.in=.service)
|
||||||
|
$(systemdservice_DATA): $(systemdservice_in_files) Makefile
|
||||||
|
@sed -e "s|\@servicedir\@|$(libexecdir)|" -e "s|\@PACKAGEKIT_USER\@|$(PACKAGEKIT_USER)|" $< > $@.tmp && mv $@.tmp $@
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
databasedir = $(PK_DB_DIR)
|
databasedir = $(PK_DB_DIR)
|
||||||
database_DATA = \
|
database_DATA = \
|
||||||
transactions.db \
|
transactions.db \
|
||||||
@ -46,6 +56,7 @@ EXTRA_DIST = \
|
|||||||
$(servicemain_in_files) \
|
$(servicemain_in_files) \
|
||||||
$(servicetest_in_files) \
|
$(servicetest_in_files) \
|
||||||
$(serviceapt_in_files) \
|
$(serviceapt_in_files) \
|
||||||
|
$(systemdservice_in_files) \
|
||||||
$(mime_in_files) \
|
$(mime_in_files) \
|
||||||
$(localcache_DATA) \
|
$(localcache_DATA) \
|
||||||
$(database_DATA) \
|
$(database_DATA) \
|
||||||
|
@ -2,4 +2,5 @@
|
|||||||
Name=org.freedesktop.PackageKit
|
Name=org.freedesktop.PackageKit
|
||||||
Exec=@servicedir@/packagekitd
|
Exec=@servicedir@/packagekitd
|
||||||
User=@PACKAGEKIT_USER@
|
User=@PACKAGEKIT_USER@
|
||||||
|
SystemdService=packagekit.service
|
||||||
|
|
||||||
|
8
data/packagekit.service.in
Normal file
8
data/packagekit.service.in
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=PackageKit Daemon
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=dbus
|
||||||
|
BusName=org.freedesktop.PackageKit
|
||||||
|
User=@PACKAGEKIT_USER@
|
||||||
|
ExecStart=@servicedir@/packagekitd
|
Loading…
Reference in New Issue
Block a user