[pve-devel] [PATCH pve-manager] check if dir /var/log/pveproxy exists.

Wolfgang Link w.link at proxmox.com
Thu Sep 15 12:25:47 CEST 2016


We will check on every start of pveproxy if the logdir are available.
If not we make a new one and give www-data permission to this dir.

The reason for this is,
if someone remove the directory /var/log/pveproxy pveproxy can't access the log.
This permit the user to use the GUI after a reboot or a restart of the service.
---
 bin/pveproxy | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/pveproxy b/bin/pveproxy
index 20e8f2a..6a624a8 100755
--- a/bin/pveproxy
+++ b/bin/pveproxy
@@ -19,6 +19,14 @@ $SIG{'__WARN__'} = sub {
     $@ = $err;
 };
 
+my $log = "/var/log/pveproxy";
+
+if (!-d $log) {
+    mkdir $log;
+    my (undef, undef, $uid, $gid) = getpwnam('www-data');
+    chown $uid, $gid, $log;
+}
+
 my $prepare = sub {
     my $rundir="/var/run/pveproxy";
     if (mkdir($rundir, 0700)) { # only works at first start if we are root)
-- 
2.1.4





More information about the pve-devel mailing list