units: add generic sysctl/hwclock-save service

This commit is contained in:
Lennart Poettering 2010-08-17 22:14:03 +02:00
parent 40b3203173
commit f556ea46f6
4 changed files with 40 additions and 2 deletions

View File

@ -156,6 +156,8 @@ dist_systemunit_DATA = \
units/var-lock.service \
units/var-run.mount \
units/var-run.service \
units/hwclock-save.service \
units/sysctl.service \
units/printer.target \
units/bluetooth.target \
units/smartcard.target

2
fixme
View File

@ -15,8 +15,6 @@
* add #ifdefs for non-sysv builds
* reinvestigate hwclock
* "disabled" load state?
* ability to kill services? i.e. in contrast to stopping them, go directly

View File

@ -0,0 +1,18 @@
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
[Unit]
Description=Update RTC With System Clock
DefaultDependencies=no
Before=poweroff.service reboot.service halt.service killall.service
[Service]
Type=oneshot
ExecStart=/sbin/hwclock --systohc
[Install]
WantedBy=shutdown.target

20
units/sysctl.service Normal file
View File

@ -0,0 +1,20 @@
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
[Unit]
Description=Apply Kernel Variables
DefaultDependencies=no
Conflicts=shutdown.target
Before=shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/sysctl -e -q -p /etc/sysctl.conf
[Install]
WantedBy=sysinit.target