Commit 2ba2236b authored by Dietmar Maurer's avatar Dietmar Maurer

correctly create /var/run/pveproxy at startup

parent 155324da
......@@ -49,10 +49,11 @@ my %daemon_options = (
);
my $rundir="/var/run/pveproxy";
mkdir($rundir, 0700);
my $gid = getgrnam('www-data') || die "getgrnam failed - $!\n";
my $uid = getpwnam('www-data') || die "getpwnam failed - $!\n";
chown($uid, $gid, $rundir);
if (mkdir($rundir, 0700)) { # only works at first start if we are root)
my $gid = getgrnam('www-data') || die "getgrnam failed - $!\n";
my $uid = getpwnam('www-data') || die "getpwnam failed - $!\n";
chown($uid, $gid, $rundir);
}
my $daemon = __PACKAGE__->new('pveproxy', $cmdline, %daemon_options);
......
......@@ -38,7 +38,14 @@ my %daemon_options = (
setuid => 'www-data',
setgid => 'www-data',
pidfile => '/var/run/pveproxy/spiceproxy.pid',
);
);
my $rundir="/var/run/pveproxy";
if (mkdir($rundir, 0700)) { # only works at first start if we are root)
my $gid = getgrnam('www-data') || die "getgrnam failed - $!\n";
my $uid = getpwnam('www-data') || die "getpwnam failed - $!\n";
chown($uid, $gid, $rundir);
}
my $daemon = __PACKAGE__->new('spiceproxy', $cmdline, %daemon_options);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment