Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 316625 - VDRAdmin init script should create directories
Summary: VDRAdmin init script should create directories
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Daniel Pielmeier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-22 08:40 UTC by Helmut Auer
Modified: 2010-04-22 17:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Auer 2010-04-22 08:40:17 UTC
Hello,
The www-misc/vdradmin-am init script should create the vdradmin directories if these are missing. I know these are created via installation, but it can happen that users clear their temp directories (especially cache and run).
This diff will fix it:

--- vdradmin-3.6.6.init.org     2010-04-22 11:50:59.000000000 +0200
+++ vdradmin-3.6.6.init 2010-04-22 12:30:04.000000000 +0200
@@ -30,9 +30,10 @@
        fi

        # Guarantee that vdradmin can access its dirs
-       chown -R "${VDRADMIN_USER}:vdradmin" /var/cache/vdradmin
-       chown -R "${VDRADMIN_USER}:vdradmin" /var/log/vdradmin
-       chown -R "${VDRADMIN_USER}:vdradmin" /var/run/vdradmin
+       for i in cache log run ; do
+               [ ! -d /var/$i/vdradmin ] && mkdir /var/$i/vdradmin
+               chown -R "${VDRADMIN_USER}:vdradmin" /var/$i/vdradmin
+       done
        chown -R "${VDRADMIN_USER}:vdradmin" /etc/vdradmin

        if [ -x /etc/init.d/root ]; then
Comment 1 Daniel Pielmeier gentoo-dev 2010-04-22 12:40:35 UTC
Makes sense, I will look into this when I find time. Also the for loop is a good idea. I just hacked something together that should work, but this a cleaner way of managing the directories. Thanks for the patch
Comment 2 Daniel Pielmeier gentoo-dev 2010-04-22 17:13:26 UTC
+  22 Apr 2010; Daniel Pielmeier <billie@gentoo.org>
+  files/vdradmin-3.6.6.init:
+  Let the init script create all needed directories under /var in case they
+  are missing. Thanks to Helmut Auer in bug #316625.

Fixed! Thanks for your report.