Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37766856
en ru br
ALT Linux repositórios
S:9.4.0-alt2
D:4.0.0-alt0.1.rc4
5.0: 4.0.13-alt2
4.1: 3.0.17-alt4
4.0: 3.0.17-alt2.M40.1
3.0: 1.3.22pl4-alt3
+backports:3.0.17-alt3.M30

Group :: Sistema/Servidores
RPM: dhcpcd

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: dhcpcd-1.3.22pl4-mdk-alt-piddir.patch
Download


diff -uprk.orig dhcpcd-1.3.22-pl4.orig/dhcpcd.8 dhcpcd-1.3.22-pl4/dhcpcd.8
--- dhcpcd-1.3.22-pl4.orig/dhcpcd.8	2003-01-01 04:31:31 +0300
+++ dhcpcd-1.3.22-pl4/dhcpcd.8	2003-10-20 14:41:33 +0400
@@ -20,6 +20,7 @@ dhcpcd
 \%[\-G\ [gateway]]
 \%[\-w\ <windowsize>]
 \%[\-L\ <ConfigDir>]
+\%[\-p\ <PidDir>]
 \%[interface]
 .in -.5i
 .SH DESCRIPTION
@@ -148,6 +149,14 @@ after receiving DHCP_OFFER on the first 
 expect the client to send second DHCP_DISCOVER message
 before replying on DHCP_REQUEST.
 .TP
+.BI \-p \ <PidDir>
+.B dhcpcd
+will use
+.I <PidDir>
+directory instead of default
+.I /var/run
+to store the pid file.
+.TP
 .BI \-R
 Prevents
 .B dhcpcd
@@ -379,7 +388,7 @@ and is restored back when
 .B dhcpcd
 exits for any reason.
 .TP
-.BI <ConfigDir>/dhcpcd-<interface>.pid
+.BI <PidDir>/dhcpcd-<interface>.pid
 file containing the process id of
 .B dhcpcd.
 The word
diff -uprk.orig dhcpcd-1.3.22-pl4.orig/dhcpcd.c dhcpcd-1.3.22-pl4/dhcpcd.c
--- dhcpcd-1.3.22-pl4.orig/dhcpcd.c	2003-01-01 04:26:32 +0300
+++ dhcpcd-1.3.22-pl4/dhcpcd.c	2003-10-20 14:41:33 +0400
@@ -69,6 +69,7 @@ int		TestCase	=	0;
 int		SendSecondDiscover	=	0;
 int		Window		=	0;
 char		*ConfigDir	=	CONFIG_DIR;
+char		*PidDir		=	PID_DIR;
 int		SetDHCPDefaultRoutes=	1;
 #if 0
 unsigned char	ClientMACaddr[ETH_ALEN];
@@ -187,6 +188,13 @@ prgs: switch ( argc[i][s] )
 	    if ( ConfigDir == NULL || ConfigDir[0] != '/' ) goto usage;
 	    s=1;
 	    break;
+	  case 'p':
+	    if ( argc[i][s+1] ) goto usage;
+	    i++;
+	    PidDir=argc[i++];
+	    if ( PidDir == NULL || PidDir[0] != '/' ) goto usage;
+	    s=1;
+	    break;
 #if 0
 	  case 'M':
 	    if ( argc[i][s+1] ) goto usage;
@@ -327,7 +335,7 @@ usage:	    print_version();
 	    fprintf(stderr,
 "Usage: dhcpcd [-dknrBCDHNRSTY] [-l leasetime] [-h hostname] [-t timeout]\n\
        [-i vendorClassID] [-I ClientID] [-c filename] [-s [ipaddr]]\n\
-       [-w windowsize] [-L ConfigDir] [-G [gateway]] [interface]\n");
+       [-w windowsize] [-L ConfigDir] [-p PidDir] [-G [gateway]] [interface]\n");
 	    exit(1);
 	}
     else
diff -uprk.orig dhcpcd-1.3.22-pl4.orig/pathnames.h dhcpcd-1.3.22-pl4/pathnames.h
--- dhcpcd-1.3.22-pl4.orig/pathnames.h	2002-09-29 19:55:31 +0400
+++ dhcpcd-1.3.22-pl4/pathnames.h	2003-10-20 14:41:33 +0400
@@ -43,4 +43,6 @@
 #define NTP_CONF		"/etc/ntp.conf"
 #endif
 
+#define PID_DIR			"/var/run"
+
 #endif
diff -uprk.orig dhcpcd-1.3.22-pl4.orig/signals.c dhcpcd-1.3.22-pl4/signals.c
--- dhcpcd-1.3.22-pl4.orig/signals.c	2002-01-21 01:51:46 +0300
+++ dhcpcd-1.3.22-pl4/signals.c	2003-10-20 14:41:33 +0400
@@ -34,6 +34,7 @@
 extern char		*ProgramName;
 extern char		*IfNameExt;
 extern char		*ConfigDir;
+extern char		*PidDir;
 extern int		DebugFlag;
 extern jmp_buf		env;
 extern void		*(*currState)();
@@ -44,7 +45,7 @@ int sig;
   FILE *fp;
   pid_t pid;
   char pidfile[64];
-  snprintf(pidfile,sizeof(pidfile),PID_FILE_PATH,ConfigDir,IfNameExt);
+  snprintf(pidfile,sizeof(pidfile),PID_FILE_PATH,PidDir,IfNameExt);
   fp=fopen(pidfile,"r");
   if ( fp == NULL ) goto ntrn;
   fscanf(fp,"%u",&pid);
@@ -63,7 +64,7 @@ void writePidFile(pid_t pid)
 {
   FILE *fp;
   char pidfile[64];
-  snprintf(pidfile,sizeof(pidfile),PID_FILE_PATH,ConfigDir,IfNameExt);
+  snprintf(pidfile,sizeof(pidfile),PID_FILE_PATH,PidDir,IfNameExt);
   fp=fopen(pidfile,"w");
   if ( fp == NULL )
     {
@@ -77,7 +78,7 @@ void writePidFile(pid_t pid)
 void deletePidFile()
 {
   char pidfile[64];
-  snprintf(pidfile,sizeof(pidfile),PID_FILE_PATH,ConfigDir,IfNameExt);
+  snprintf(pidfile,sizeof(pidfile),PID_FILE_PATH,PidDir,IfNameExt);
   unlink(pidfile);
 }
 /*****************************************************************************/
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009