From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id 687CD1FF162
	for <inbox@lore.proxmox.com>; Sat, 22 Mar 2025 16:26:17 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 0D7063C18B;
	Sat, 22 Mar 2025 16:26:06 +0100 (CET)
To: pve-devel@lists.proxmox.com
Date: Sun, 23 Mar 2025 00:17:08 +0900
MIME-Version: 1.0
Message-ID: <mailman.84.1742657164.359.pve-devel@lists.proxmox.com>
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Post: <mailto:pve-devel@lists.proxmox.com>
From: Jing Luo via pve-devel <pve-devel@lists.proxmox.com>
Precedence: list
Cc: Jing Luo <jing@jing.rocks>
X-Mailman-Version: 2.1.29
X-BeenThere: pve-devel@lists.proxmox.com
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
Subject: [pve-devel] [PATCH pve-manager] tree-wide: change /var/run to /run
 and /var/lock to /run/lock
Content-Type: multipart/mixed; boundary="===============4967520154833784244=="
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

--===============4967520154833784244==
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <jing@jing.rocks>
X-Original-To: pve-devel@lists.proxmox.com
Delivered-To: pve-devel@lists.proxmox.com
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by lists.proxmox.com (Postfix) with ESMTPS id 94070C93B5
	for <pve-devel@lists.proxmox.com>; Sat, 22 Mar 2025 16:26:03 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 6CD273BD58
	for <pve-devel@lists.proxmox.com>; Sat, 22 Mar 2025 16:25:33 +0100 (CET)
Received: from mail-gw3.jing.rocks (mail-gw3.jing.rocks [219.117.250.209])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by firstgate.proxmox.com (Proxmox) with ESMTPS
	for <pve-devel@lists.proxmox.com>; Sat, 22 Mar 2025 16:25:28 +0100 (CET)
Received: from mail-gw3.jing.rocks (localhost [127.0.0.1])
	by mail-gw3.jing.rocks (Proxmox) with ESMTP id EB2D3165BD
	for <pve-devel@lists.proxmox.com>; Sun, 23 Mar 2025 00:20:16 +0900 (JST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jing.rocks; h=cc
	:cc:content-transfer-encoding:date:from:from:message-id
	:mime-version:reply-to:subject:subject:to:to; s=mail-gw; bh=HxNu
	50eJKRlMwN1cZyZQdRuGckQqFPZz0sI+Q+rHsQ8=; b=b7wAUjVDYzgkdKy59Sb7
	2zsNCjrnViDlpBIOeVJQXJVXNe+yQFKJj+6qkUU4Qi0CmDdpNonmTZV6fZgfqZ+3
	EBmRfdFLe516RGkx+H1RzW5c1GLZWJMYF/rDJs661bS6EFjCeRnmo75RA6OTsFQ2
	F2V143Y0AboxdSQMmg/yvUM3IMBs0DWzSPoH09hQIKsAr/qdX49EKZegsb+TBaYv
	VozrBlL187W/PlP7IXeUjXcqmIrB9NbSUB1I+lLAHuUfpAOYFxZhMW9//cyle1Wp
	QG0Q9Mt7nLGpln2A7xb0gypkEfiM7ZJh1NsvKWv/PE6JVbRwQdRMhXFzPqqEHHt4
	lA==
Received: from mail.jing.rocks (mail.jing.rocks [IPv6:240b:10:f00:1b00::222])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by mail-gw3.jing.rocks (Proxmox) with ESMTPS id 8B639164DA
	for <pve-devel@lists.proxmox.com>; Sun, 23 Mar 2025 00:20:14 +0900 (JST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=jing.rocks;
	s=default; t=1742656814;
	bh=LT9FrSxQGB09rEIF2MRHjUlNMU3HT1qs9ABwLANVJyo=;
	h=From:To:Cc:Subject:Date:From;
	b=sbx9DRFKsBlnPjyTSnkapp992P+mEdjv9jDiQu28Z7345iyGEWAg+9ebT8whpEJQe
	 YLMgqysOwDBCtvJw2W3Ql6+0ZRnz6Nr0oE7BwFTnBofdLhtR3p1Cpc2h63IQ6xy3Sl
	 DZGN6yUMs4X2fR3h54lCN3txZ78yrD1i90ei7AgOtLz6/qxhz/guNaW21ixWarvgxP
	 090HCmHw+i5fljdK1QNSvZdW0ALhVgiHKqXIqMmg7IR9RydzfkSRBeUEkIhdS15tuh
	 YtRcFfMtzqKUfC1syKWj7WybKjap9X5gm5Domg+aNcb74zhhUEvcqu1EwVfw+XWF+f
	 ZsqGsmb90oEbw==
Received: from X570AM.jing.rocks (X570AM.lan [IPv6:240b:10:f00:1b00::7e82])
	(Authenticated sender: jing@jing.rocks)
	by mail.jing.rocks (Postfix) with ESMTPSA id 7B3E737F3D;
	Sun, 23 Mar 2025 00:20:14 +0900 (JST)
From: Jing Luo <jing@jing.rocks>
To: pve-devel@lists.proxmox.com
Cc: Jing Luo <jing@jing.rocks>
Subject: [PATCH pve-manager] tree-wide: change /var/run to /run and /var/lock to /run/lock
Date: Sun, 23 Mar 2025 00:17:08 +0900
Message-ID: <20250322152004.1646886-1-jing@jing.rocks>
X-Mailer: git-send-email 2.49.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
	AWL                    -0.001 Adjusted score from AWL reputation of From: address
	BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
	DKIM_SIGNED               0.1 Message has a DKIM or DK signature, not necessarily valid
	DKIM_VALID               -0.1 Message has at least one valid DKIM or DK signature
	DKIM_VALID_AU            -0.1 Message has a valid DKIM or DK signature from author's domain
	DKIM_VALID_EF            -0.1 Message has a valid DKIM or DK signature from envelope-from domain
	DMARC_PASS               -0.1 DMARC pass policy
	KAM_INFOUSMEBIZ          0.75 Prevalent use of .info|.us|.me|.me.uk|.biz|xyz|id|rocks|life domains in spam/malware
	KAM_OTHER_BAD_TLD        0.75 Other untrustworthy TLDs
	RCVD_IN_VALIDITY_CERTIFIED_BLOCKED  0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked.  See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information.
	RCVD_IN_VALIDITY_RPBL_BLOCKED  0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked.  See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information.
	RCVD_IN_VALIDITY_SAFE_BLOCKED  0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked.  See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information.
	SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
	SPF_PASS               -0.001 SPF: sender matches SPF record

"/var/run" and "/var/lock" are deprecated.

This is to comply with Debian Policy 9.1.4 "/run and /run/lock".
(https://www.debian.org/doc/debian-policy/ch-opersys.html#run-and-run-lock)

Signed-off-by: Jing Luo <jing@jing.rocks>
---
 PVE/API2/Nodes.pm             | 4 ++--
 PVE/API2/Replication.pm       | 2 +-
 PVE/CertHelpers.pm            | 2 +-
 PVE/Jobs.pm                   | 2 +-
 PVE/NodeConfig.pm             | 2 +-
 PVE/Service/pvedaemon.pm      | 2 +-
 PVE/Service/pveproxy.pm       | 4 ++--
 PVE/Service/spiceproxy.pm     | 4 ++--
 PVE/VZDump.pm                 | 6 +++---
 bin/pvedaemon                 | 2 +-
 bin/pveproxy                  | 2 +-
 bin/spiceproxy                | 2 +-
 services/pvescheduler.service | 2 +-
 13 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 9cdf19db..3708eb26 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -1978,7 +1978,7 @@ __PACKAGE__->register_method ({
 	    }
 
 	    eval { # remove backup locks, but avoid running into a scheduled backup job
-		PVE::Tools::lock_file('/var/run/vzdump.lock', 10, $remove_locks_on_startup, $nodename);
+		PVE::Tools::lock_file('/run/vzdump.lock', 10, $remove_locks_on_startup, $nodename);
 	    };
 	    warn $@ if $@;
 
@@ -2540,7 +2540,7 @@ __PACKAGE__->register_method ({
     code => sub {
 	my ($param) = @_;
 
-	PVE::Tools::lock_file('/var/lock/pve-etchosts.lck', undef, sub {
+	PVE::Tools::lock_file('/run/lock/pve-etchosts.lck', undef, sub {
 	    if ($param->{digest}) {
 		my $hosts = PVE::INotify::read_file('etchosts');
 		PVE::Tools::assert_if_modified($hosts->{digest}, $param->{digest});
diff --git a/PVE/API2/Replication.pm b/PVE/API2/Replication.pm
index e4a7180f..9d2aff5b 100644
--- a/PVE/API2/Replication.pm
+++ b/PVE/API2/Replication.pm
@@ -21,7 +21,7 @@ use PVE::RESTHandler;
 
 use base qw(PVE::RESTHandler);
 
-our $pvesr_lock_path = "/var/lock/pvesr.lck";
+our $pvesr_lock_path = "/run/lock/pvesr.lck";
 
 our $lookup_guest_class = sub {
     my ($vmtype) = @_;
diff --git a/PVE/CertHelpers.pm b/PVE/CertHelpers.pm
index 7e088cb9..38e8d9ca 100644
--- a/PVE/CertHelpers.pm
+++ b/PVE/CertHelpers.pm
@@ -30,7 +30,7 @@ PVE::JSONSchema::register_standard_option('pve-acme-directory-url', {
     pattern => '^https?://.*',
 });
 
-my $local_cert_lock = '/var/lock/pve-certs.lock';
+my $local_cert_lock = '/run/lock/pve-certs.lock';
 
 sub cert_path_prefix {
     my ($node) = @_;
diff --git a/PVE/Jobs.pm b/PVE/Jobs.pm
index bd323332..6f94eb0e 100644
--- a/PVE/Jobs.pm
+++ b/PVE/Jobs.pm
@@ -21,7 +21,7 @@ cfs_register_file(
 );
 
 my $state_dir = "/var/lib/pve-manager/jobs";
-my $lock_dir = "/var/lock/pve-manager";
+my $lock_dir = "/run/lock/pve-manager";
 
 my $get_state_file = sub {
     my ($jobid, $type) = @_;
diff --git a/PVE/NodeConfig.pm b/PVE/NodeConfig.pm
index 5f58dff5..4235ecea 100644
--- a/PVE/NodeConfig.pm
+++ b/PVE/NodeConfig.pm
@@ -13,7 +13,7 @@ use PVE::API2::ACMEPlugin;
 # register up to 5 domain names per node for now
 my $MAXDOMAINS = 5;
 
-my $node_config_lock = '/var/lock/pvenode.lock';
+my $node_config_lock = '/run/lock/pvenode.lock';
 
 PVE::JSONSchema::register_format('pve-acme-domain', sub {
     my ($domain, $noerr) = @_;
diff --git a/PVE/Service/pvedaemon.pm b/PVE/Service/pvedaemon.pm
index 486d264c..c77683be 100755
--- a/PVE/Service/pvedaemon.pm
+++ b/PVE/Service/pvedaemon.pm
@@ -26,7 +26,7 @@ my $daemon = __PACKAGE__->new('pvedaemon', $cmdline, %daemon_options);
 sub init {
     my ($self) = @_;
 
-    my $accept_lock_fn = "/var/lock/pvedaemon.lck";
+    my $accept_lock_fn = "/run/lock/pvedaemon.lck";
 
     my $lockfh = IO::File->new(">>${accept_lock_fn}") ||
 	die "unable to open lock file '${accept_lock_fn}' - $!\n";
diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm
index df3601bd..bc05abe6 100755
--- a/PVE/Service/pveproxy.pm
+++ b/PVE/Service/pveproxy.pm
@@ -35,7 +35,7 @@ my %daemon_options = (
     leave_children_open_on_reload => 1,
     setuid => 'www-data',
     setgid => 'www-data',
-    pidfile => '/var/run/pveproxy/pveproxy.pid',
+    pidfile => '/run/pveproxy/pveproxy.pid',
 );
 
 my $daemon = __PACKAGE__->new('pveproxy', $cmdline, %daemon_options);
@@ -65,7 +65,7 @@ sub init {
     # we use same ALLOW/DENY/POLICY as pveproxy
     my $proxyconf = PVE::APIServer::Utils::read_proxy_config($self->{name});
 
-    my $accept_lock_fn = "/var/lock/pveproxy.lck";
+    my $accept_lock_fn = "/run/lock/pveproxy.lck";
 
     my $lockfh = IO::File->new(">>${accept_lock_fn}") ||
 	die "unable to open lock file '${accept_lock_fn}' - $!\n";
diff --git a/PVE/Service/spiceproxy.pm b/PVE/Service/spiceproxy.pm
index 50b81c18..d06467e3 100755
--- a/PVE/Service/spiceproxy.pm
+++ b/PVE/Service/spiceproxy.pm
@@ -23,7 +23,7 @@ my %daemon_options = (
     leave_children_open_on_reload => 1,
     setuid => 'www-data',
     setgid => 'www-data',
-    pidfile => '/var/run/pveproxy/spiceproxy.pid',
+    pidfile => '/run/pveproxy/spiceproxy.pid',
     );
 
 my $daemon = __PACKAGE__->new('spiceproxy', $cmdline, %daemon_options); 
@@ -34,7 +34,7 @@ sub init {
     # we use same ALLOW/DENY/POLICY as pveproxy
     my $proxyconf = PVE::APIServer::Utils::read_proxy_config('pveproxy');
 
-    my $accept_lock_fn = "/var/lock/spiceproxy.lck";
+    my $accept_lock_fn = "/run/lock/spiceproxy.lck";
 
     my $lockfh = IO::File->new(">>${accept_lock_fn}") ||
 	die "unable to open lock file '${accept_lock_fn}' - $!\n";
diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index fd89945e..5178ce9d 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -40,8 +40,8 @@ PVE::JSONSchema::register_standard_option('pve-backup-jobid', {
 
 my @posix_filesystems = qw(ext3 ext4 nfs nfs4 reiserfs xfs);
 
-my $lockfile = '/var/run/vzdump.lock';
-my $pidfile = '/var/run/vzdump.pid';
+my $lockfile = '/run/vzdump.lock';
+my $pidfile = '/run/vzdump.pid';
 my $logdir = '/var/log/vzdump';
 
 my @plugins = qw();
@@ -661,7 +661,7 @@ sub new {
 	push @$findexcl,
 	    '/tmp/?*',
 	    '/var/tmp/?*',
-	    '/var/run/?*.pid',
+	    '/run/?*.pid',
 	    ;
     }
 
diff --git a/bin/pvedaemon b/bin/pvedaemon
index ffccb34f..54b28770 100755
--- a/bin/pvedaemon
+++ b/bin/pvedaemon
@@ -21,7 +21,7 @@ $SIG{'__WARN__'} = sub {
 
 my $prepare = sub {
     # create dir for dtach sockets
-    mkdir "/var/run/dtach";
+    mkdir "/run/dtach";
 };
 
 PVE::Service::pvedaemon->run_cli_handler(prepare => $prepare);
diff --git a/bin/pveproxy b/bin/pveproxy
index 20e8f2ab..4430c37e 100755
--- a/bin/pveproxy
+++ b/bin/pveproxy
@@ -20,7 +20,7 @@ $SIG{'__WARN__'} = sub {
 };
 
 my $prepare = sub {
-    my $rundir="/var/run/pveproxy";
+    my $rundir="/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";
diff --git a/bin/spiceproxy b/bin/spiceproxy
index 790c6dff..ea98a3f7 100755
--- a/bin/spiceproxy
+++ b/bin/spiceproxy
@@ -19,7 +19,7 @@ $SIG{'__WARN__'} = sub {
 };
 
 my $prepare  = sub {
-    my $rundir="/var/run/pveproxy";
+    my $rundir="/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";
diff --git a/services/pvescheduler.service b/services/pvescheduler.service
index 6d0d0985..8f410101 100644
--- a/services/pvescheduler.service
+++ b/services/pvescheduler.service
@@ -10,7 +10,7 @@ After=pve-storage.target
 ExecStart=/usr/bin/pvescheduler start
 ExecStop=/usr/bin/pvescheduler stop
 ExecReload=/usr/bin/pvescheduler restart
-PIDFile=/var/run/pvescheduler.pid
+PIDFile=/run/pvescheduler.pid
 KillMode=process
 Type=forking
 
-- 
2.49.0




--===============4967520154833784244==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

--===============4967520154833784244==--