Commit Graph
23 Commits
Author SHA1 Message Date
Joachim Nilsson 36f38d5a13 initctl: Only append space between args, not at last arg
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-06-29 22:21:33 +02:00
Petrus Hellgren fafeaf661a inetd: remove ntoh on proto
getprotobyname() returns p_proto in host endian, so it should not be
converted with ntoh. (Note: getservbyname() on the other hand does
return s_port in network endian)

Signed-off-by: Petrus Hellgren <petrus.hellgren@westermo.se>
2017-04-25 10:39:09 +02:00
crazy 885056a6c9 networking(): check first ifup exists
Check first ifup exists before using it since
   this is really something only exits on some
   distros an in different ways. Debian/Ubunu has
   an package for this while others have it in the
   initscripts package(s) , meaning the file can be
   around even without the prog.

Signed-off-by: crazy <crazy@frugalware.org>
2017-03-28 13:21:20 +02:00
crazy a44daf20cb finit.c: set _PATH_STDPATH much earlier
This should allow us to run 'prog' without
     absolute paths.  Eg:

     run("/bin/foo"); -> run("foo");

     However we still need absolute PATH for
     checking since fexist() need full path right now.

Signed-off-by: crazy <crazy@frugalware.org>
2017-03-28 13:21:18 +02:00
crazy 67435d2034 finit.h: added fallback for _PATH_{STDPATH,VARRUN} in case is not defined
That should never be needed , however I saw
  already systems with broken paths.h so better
  have something around in case something breaks.

Signed-off-by: crazy <crazy@frugalware.org>
2017-03-28 13:21:14 +02:00
Joachim Nilsson c135a83cb3 Check if /proc/bus/usb exists before trying to mount it
Most newer kernels have usbfs disabled by default.
See issue #69 for details.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-03-20 20:41:09 +01:00
Joachim Nilsson 47793dcdf2 sm.c: Add missing header
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-03-08 08:26:13 +01:00
Joachim Nilsson 9df0454b64 initctl: Support for utmp show FILE
This patch adds support for showing a log rotated (uncompressed)
UTMP/WTMP file in initctl.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-02-10 11:44:57 +01:00
Joachim Nilsson 5ea1ac7582 Followup to #66: Gzip log files >= .2
This patch to the logrotate() function extends the log rotattion of a
file with a gzip of .2 and older log files.  If gzip is not available
in $PATH then @num files are left uncompressed.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-02-10 11:00:17 +01:00
Joachim Nilsson 9f7604848c initctl: Remove no longer neede source files from build
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-02-10 10:21:27 +01:00
Joachim Nilsson bbbaba7b47 Minor cleanup
initctl: Replace daemon-only API from user tool
utmp-api.c: Remove not needed header

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-02-10 10:20:29 +01:00
Joachim Nilsson d56031db7d svc.c: Replace daemon-only logging API with API from err.h
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-02-10 10:19:00 +01:00
Joachim Nilsson 0f64e18f27 Relocate utmp_show() to initctl.c
Only used by this tool, no need to keep it in the shared utmp-api.c

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-02-10 10:17:41 +01:00
Joachim Nilsson 958cab8cc7 Relocate runlevel_string() to initctl.c
Only used by this tool, no need to keep it in helpers.c

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-02-10 10:11:52 +01:00
Joachim Nilsson 9974d65756 Fix #66: Rotate /var/log/wtmp log max:2, size:100k
This patch adds a simple log-rotate function to the UTMP, WTMP, BTMP,
and lastlog files.  Enabled by default, disable with:

    configure --disable-logrotate

Even though it can rotate /run/utmp it is unlikely this file will grow
that much during a system's uptime.

The hard-coded defaults are to keep up to two (2) previous versions
of the files and rotate on file size >= 100k.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-25 19:40:06 +01:00
Joachim Nilsson a0e17c8f47 Relocate create() from bootmisc plugin to helpers.h
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-25 19:40:06 +01:00
Joachim Nilsson f76268dec9 initctl: Fix build warnings after de4bf53
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-24 09:15:30 +01:00
Joachim Nilsson 8d74a12628 Fix #64: Skip fsck of already mounted devices
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-24 08:03:53 +01:00
Joachim Nilsson 33ae64495a finit.c: Mount /proc and /sys before fsck()
For issue #64 we need to have /proc/mounts, or /etc/mtab but that's
usually symlinked to /proc/mounts.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-24 07:57:19 +01:00
Mattias Walström de4bf53536 initctl: Add 'initctl cond dump' to show all conditions in the system
Remove verbose of initctl cond, and replace it with 'initctl cond dump'
Show all conditions if they are in flux/on even if there are no other
services depending on this condition.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2017-01-18 16:15:52 +01:00
Joachim Nilsson 1d39decaf1 Update .gitignore files
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-16 07:32:09 +01:00
Joachim Nilsson 19d89d627b Add src/.gitignore
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-16 01:35:06 +01:00
Joachim Nilsson fff68b7b06 Relocate source files to an src/ subdirectory
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-16 01:31:02 +01:00