Compare commits

...

13 Commits

Author SHA1 Message Date
pepe 38ddf2aece :( 2023-05-30 06:58:35 +00:00
Jesse 3401b62142 Merge branch '3.07' 2023-04-30 13:56:01 -03:00
Jesse 5e82478a24 Merge branch '3.07' of https://github.com/slicer69/sysvinit into 3.07 2023-04-18 17:34:43 -03:00
Jesse 4a4228b1b7 Fixed typo 2023-04-18 17:33:45 -03:00
Jesse c06458e1c1 Accepted patch from Mark Hindley which avoids clearing realpath information
in pidof when trying to find matching executables.
2023-04-18 17:33:30 -03:00
Jesse 93da64d133 Accepted patch from Mark Hindle which avoids clearing realpath information
in pidof when trying to find matching executables.
2023-03-29 10:34:45 -03:00
Jesse e7f4361bde Clarified pidof manual page to indicate pidof does not make multiple hops
through symbolic links.
2023-03-28 10:46:02 -03:00
Jesse b6aacf3b68 Fixed memory initialization error in pidof. Fix provided by Markus Fischer. 2023-03-24 11:18:02 -03:00
Jesse b70b2776ed pidof was not returning PIDs of programs which were launched
using a symbolic link. (ie /tmp/sleep when /tmp/sleep links to /usr/bin/sleep).
This is now fixed as we check both the realpath and symbolic path for processes.
In other words, "pidof /tmp/sleep" and "pidof /usr/bin/sleep" will return
the same PIDs when /tmp/sleep is a symbolic link to /usr/bin/sleep.
2023-03-22 12:34:55 -03:00
Jesse 86c5d7b93c Fixed killall5 usage message to be more accurate. Command
can accept more than one parameter and that is now mentioned.
2023-02-19 00:47:22 -04:00
Jesse e7cf1f2b94 Re-added man/po/pt.po translation file. 2023-01-05 17:48:13 -04:00
Jesse 82c2a211fa Reverted translation change which breaks build. 2023-01-05 13:52:11 -04:00
Jesse e8cc829689 Re-adding original .po files. 2023-01-05 13:49:31 -04:00
5 changed files with 4743 additions and 450 deletions

View File

@ -1,6 +1,16 @@
sysvinit (3.07) released; urgency=low
* Fixed killall5 so that processes in the omit list are
not sent any signals, including SIGSTOP.
* Fixed usage message for killall5 to be more accurate.
* pidof was not returning PIDs of programs which were launched
using a symbolic link. (ie /tmp/sleep when /tmp/sleep links to /usr/bin/sleep).
This is now fixed as we check both the realpath and symbolic path for processes.
In other words, "pidof /tmp/sleep" and "pidof /usr/bin/sleep" will return
the same PIDs when /tmp/sleep is a symbolic link to /usr/bin/sleep.
* Fixed memory initialization error in pidof. Fix provided by Markus Fischer.
* Accepted patch from Mark Hindley which avoids clearing realpath information
in pidof when trying to find matching executables.
sysvinit (3.06) released; urgency=low
* Mark Hindley fixed typo in es.po

File diff suppressed because it is too large Load Diff

4638
man/po/pt.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -60,6 +60,16 @@ MAN8 += sulogin.8
MANDB :=
endif
ifeq ($(DISTRO),Void)
BIN = fstab-decode halt init killall5 readbootlog runlevel shutdown
SBIN =
USRBIN =
MAN1 = readbootlog.1
MAN5 = initscript.5 inittab.5 initctl.5
MAN8 = halt.8 init.8 killall5.8 poweroff.8 reboot.8 runlevel.8 shutdown.8
MAN8 += telinit.8 fstab-decode.8
endif
ifeq ($(MNTPOINT),yes)
BIN += mountpoint
MAN1 += mountpoint.1
@ -79,8 +89,8 @@ else
INSTALL_EXEC = install -m 755
INSTALL_DATA = install -m 644
endif
INSTALL_DIR = install -m 755 -d
MANDIR = /usr/share/man
INSTALL_DIR = true
MANDIR = /share/man
ifeq ($(WITH_SELINUX),yes)
SELINUX_DEF = -DWITH_SELINUX
@ -210,27 +220,14 @@ install: all
# $(INSTALL_DIR) $(ROOT)/etc/
$(INSTALL_DIR) $(ROOT)/etc/inittab.d
# $(INSTALL_EXEC) ../doc/initscript.sample $(ROOT)/etc/
ln -sf halt $(ROOT)/sbin/reboot
ln -sf halt $(ROOT)/sbin/poweroff
ln -sf init $(ROOT)/sbin/telinit
ln -sf ../sbin/killall5 $(ROOT)/bin/pidof
if [ ! -f $(ROOT)/usr/bin/lastb ]; then \
ln -sf last $(ROOT)/usr/bin/lastb; \
fi
$(INSTALL_DIR) $(ROOT)/usr/include/
$(INSTALL_DATA) initreq.h $(ROOT)/usr/include/
ln -sf halt $(ROOT)/bin/reboot
ln -sf halt $(ROOT)/bin/poweroff
ln -sf init $(ROOT)/bin/telinit
$(INSTALL_DIR) $(ROOT)/include/
$(INSTALL_DATA) initreq.h $(ROOT)/include/
for man in $(MANPAGES) ; do \
targetdir=$(ROOT)$(MANDIR)/$$(dirname $$man)/man$${man##*.}; \
$(INSTALL_DIR) $$targetdir; \
$(INSTALL_DATA) ../man/$$man $$targetdir/$$(basename $$man); \
sed -i "1{ $(MANDB); }" $$targetdir/$$(basename $$man); \
done
ifeq ($(ROOT),)
#
# This part is skipped on Debian systems, the
# debian.preinst script takes care of it.
@if [ ! -p /run/initctl ]; then \
echo "Creating /run/initctl"; \
rm -f /run/initctl; \
mknod -m 600 /run/initctl p; fi
endif

View File

@ -662,6 +662,7 @@ int readproc()
/* Try to stat the executable. */
snprintf(path, sizeof(path), "/proc/%s/exe", d->d_name);
p->pathname = (char *)xmalloc(PATH_MAX);
memset(p->pathname, 0, PATH_MAX);
if (readlink(path, p->pathname, PATH_MAX) == -1) {
p->pathname = NULL;
}
@ -739,8 +740,8 @@ PIDQ_HEAD *pidof(char *prog)
return NULL;
/* Try to stat the executable. */
memset(real_path, 0, sizeof(real_path));
if ( (prog[0] == '/') && ( realpath(prog, real_path) ) ) {
memset(&real_path[0], 0, sizeof(real_path));
dostat++;
}
@ -763,6 +764,11 @@ PIDQ_HEAD *pidof(char *prog)
add_pid_to_q(q, p);
foundone++;
}
else if ( (p->argv0) && (! strcmp(p->argv0, prog) ) )
{
add_pid_to_q(q, p);
foundone++;
}
}
}
@ -826,6 +832,7 @@ PIDQ_HEAD *pidof(char *prog)
* as was done in earlier versions of this program, since this
* allows /aaa/foo to match /bbb/foo .
*/
ok |=
(p->argv0 && strcmp(p->argv0, prog) == 0)
|| (p->argv0 && s != prog && strcmp(p->argv0, s) == 0)
@ -873,7 +880,7 @@ PIDQ_HEAD *pidof(char *prog)
/* Give usage message and exit. */
void usage(void)
{
nsyslog(LOG_ERR, "only one argument, a signal number, allowed");
nsyslog(LOG_ERR, "usage: killall5 -signum [-o omitpid] [-o omitpid] ...");
closelog();
exit(1);
}