creating directories under /run
Unstable has had /run on a tmpfs for a while now and scripts have been changed
to call mkdir as necessary.
Unfortunately some of the directories are created with the wrong SE Linux
context and need to have restorecon run on them.
As an example below is the change I needed to make to the xend start script to
get the correct context. As there aren't THAT many scripts doing such things
I could just file bug reports with patches against all of them. But it seems
that there is a possibility that things other than SE Linux could be affected
in future. Having changes to init scripts is just annoying and it would be
good to get the issue resolved. I'd like to make this as easy as possible for
the people who maintain daemon packages.
# diff xend.orig xend
92c92,96
< [ -d "$XENSTORED_DIR" ] || mkdir -p "$XENSTORED_DIR"
---
> if [ ! -d "$XENSTORED_DIR" ]; then
> mkdir -p "$XENSTORED_DIR"
> [ -x /sbin/restorecon ] && /sbin/restorecon "$XENSTORED_DIR"
> fi
>
I think it would be good to have a shell script that will create a directory
under /run and do whatever else is necessary. So the package maintainer
doesn't need to care about what really happens, they just have a line like the
following:
/sbin/make_run_dir "$XENSTORED_DIR"
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638304
Another possibility would be to mandate the use of install for such creation,
it doesn't work correctly at this time (see the above bug) but can be fixed.
An advantage of this is that it works for directories and files - but it would
be good to have install create symlinks and pipes.
What do you think?
--
My Main Blog http://etbe.coker.com.au/
My Documents Blog http://doc.coker.com.au/
Reply to: