From a76cf296f7c9c7b8a307762f0cd13ad645a02e9c Mon Sep 17 00:00:00 2001 From: Evgeny Sinelnikov Date: Thu, 28 Nov 2019 00:36:10 +0400 Subject: [PATCH] Add systemd service unit for gpupdate --- gpupdate.service | 12 ++++++++++++ gpupdate.spec | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100644 gpupdate.service diff --git a/gpupdate.service b/gpupdate.service new file mode 100644 index 0000000..57880e9 --- /dev/null +++ b/gpupdate.service @@ -0,0 +1,12 @@ +[Unit] +Description=Group policy update for machine +After=sssd.service + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStart=/usr/bin/gpupdate +StandardOutput=journal + +[Install] +WantedBy=multi-user.target diff --git a/gpupdate.spec b/gpupdate.spec index eb78b4f..5c90a2c 100644 --- a/gpupdate.spec +++ b/gpupdate.spec @@ -36,11 +36,20 @@ mkdir -p \ ln -s %python3_sitelibdir/gpoa/main.py \ %buildroot%_sbindir/gpoa +install -Dm0644 %name.service %buildroot%_unitdir/%name.service + +%preun +%preun_service gpupdate + +%post +%post_service gpupdate + %files %_sbindir/gpoa %_bindir/gpupdate %attr(755,root,root) %python3_sitelibdir/gpoa/main.py %python3_sitelibdir/gpoa +%_unitdir/%name.service %changelog * Sun Nov 17 2019 Evgeny Sinelnikov 0.0.3-alt1