]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
uuidd.rc: create localstatedir in init script
authorChristian Hesse <mail@eworm.de>
Tue, 27 Feb 2024 12:07:30 +0000 (13:07 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 29 Feb 2024 08:40:03 +0000 (09:40 +0100)
Signed-off-by: Christian Hesse <mail@eworm.de>
(cherry picked from commit b3fdc48a5672ae39b6ceceb7e46a5e1351f06fb6)

misc-utils/uuidd.rc.in

index 7943945622faa14e4971ccd4f2b74d4b789e1fcb..49190494632d309037ddd756ee6ad680f09bc6b3 100644 (file)
@@ -17,8 +17,9 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin
 DAEMON=/usr/sbin/uuidd
 UUIDD_USER=uuidd
 UUIDD_GROUP=uuidd
-UUIDD_DIR=@runstatedir@/uuidd
-PIDFILE=$UUIDD_DIR/uuidd.pid
+UUIDD_RUNSTATEDIR=@runstatedir@/uuidd
+UUIDD_LOCALSTATEDIR=@localstatedir@/lib/libuuid
+PIDFILE=$UUIDD_RUNSTATEDIR/uuidd.pid
 
 test -x $DAEMON || exit 0
 
@@ -27,9 +28,13 @@ test -x $DAEMON || exit 0
 case "$1" in
   start)
        log_daemon_msg "Starting uuid generator" "uuidd"
-       if ! test -d $UUIDD_DIR; then
-               mkdir -p $UUIDD_DIR
-               chown -R $UUIDD_USER:$UUIDD_GROUP $UUIDD_DIR
+       if ! test -d $UUIDD_RUNSTATEDIR; then
+               mkdir -p $UUIDD_RUNSTATEDIR
+               chown -R $UUIDD_USER:$UUIDD_GROUP $UUIDD_RUNSTATEDIR
+       fi
+       if ! test -d $UUIDD_LOCALSTATEDIR; then
+               mkdir -p $UUIDD_LOCALSTATEDIR
+               chown -R $UUIDD_USER:$UUIDD_GROUP $UUIDD_LOCALSTATEDIR
        fi
        start_daemon -p $PIDFILE $DAEMON
        log_end_msg $?