Rename MINIX service(8) to minix-service(8)

IMPORTANT: this change has a docs/UPDATING entry!

This rename is unfortunately necessary because NetBSD has decided to
create its own service(8) utility, and we will want to import theirs
as well.  The two can obviously not coexist.

Also move ours from /bin to /sbin, as it is a superuser-only utility.

Change-Id: Ic6e46ffb3a84b4747d2fdcb0d74e62dbea065039
This commit is contained in:
David van Moolenbroek 2017-02-22 15:23:10 +00:00
parent bf5536d653
commit c58da9fbc3
59 changed files with 205 additions and 181 deletions

View File

@ -36,7 +36,7 @@
./bin/mv minix-base ./bin/mv minix-base
./bin/netconf minix-base ./bin/netconf minix-base
./bin/pax minix-base ./bin/pax minix-base
./bin/printconfig minix-base ./bin/printconfig minix-base obsolete
./bin/printroot minix-base ./bin/printroot minix-base
./bin/ps minix-base ./bin/ps minix-base
./bin/pwd minix-base ./bin/pwd minix-base
@ -46,7 +46,7 @@
./bin/readclock minix-base ./bin/readclock minix-base
./bin/rm minix-base ./bin/rm minix-base
./bin/rmdir minix-base ./bin/rmdir minix-base
./bin/service minix-base ./bin/service minix-base obsolete
./bin/setup minix-base ./bin/setup minix-base
./bin/sh minix-base ./bin/sh minix-base
./bin/sleep minix-base ./bin/sleep minix-base
@ -185,6 +185,7 @@
./sbin/fsck_mfs minix-base ./sbin/fsck_mfs minix-base
./sbin/halt minix-base ./sbin/halt minix-base
./sbin/init minix-base ./sbin/init minix-base
./sbin/minix-service minix-base
./sbin/mkfs.mfs minix-base ./sbin/mkfs.mfs minix-base
./sbin/mknod minix-base ./sbin/mknod minix-base
./sbin/newfs_ext2fs minix-base ./sbin/newfs_ext2fs minix-base
@ -194,6 +195,7 @@
./sbin/nologin minix-base ./sbin/nologin minix-base
./sbin/ping minix-base ./sbin/ping minix-base
./sbin/poweroff minix-base ./sbin/poweroff minix-base
./sbin/printconfig minix-base
./sbin/reboot minix-base ./sbin/reboot minix-base
./sbin/shutdown minix-base ./sbin/shutdown minix-base
./sbin/sysctl minix-base ./sbin/sysctl minix-base

View File

@ -134,7 +134,7 @@
./usr/libdata/debug/bin/mount.debug minix-debug debug ./usr/libdata/debug/bin/mount.debug minix-debug debug
./usr/libdata/debug/bin/mv.debug minix-debug debug ./usr/libdata/debug/bin/mv.debug minix-debug debug
./usr/libdata/debug/bin/pax.debug minix-debug debug ./usr/libdata/debug/bin/pax.debug minix-debug debug
./usr/libdata/debug/bin/printconfig.debug minix-debug debug ./usr/libdata/debug/bin/printconfig.debug minix-debug debug,obsolete
./usr/libdata/debug/bin/printroot.debug minix-debug debug ./usr/libdata/debug/bin/printroot.debug minix-debug debug
./usr/libdata/debug/bin/ps.debug minix-debug debug ./usr/libdata/debug/bin/ps.debug minix-debug debug
./usr/libdata/debug/bin/pwd.debug minix-debug debug ./usr/libdata/debug/bin/pwd.debug minix-debug debug
@ -143,7 +143,7 @@
./usr/libdata/debug/bin/readclock.debug minix-debug debug ./usr/libdata/debug/bin/readclock.debug minix-debug debug
./usr/libdata/debug/bin/rm.debug minix-debug debug ./usr/libdata/debug/bin/rm.debug minix-debug debug
./usr/libdata/debug/bin/rmdir.debug minix-debug debug ./usr/libdata/debug/bin/rmdir.debug minix-debug debug
./usr/libdata/debug/bin/service.debug minix-debug debug ./usr/libdata/debug/bin/service.debug minix-debug debug,obsolete
./usr/libdata/debug/bin/sh.debug minix-debug debug ./usr/libdata/debug/bin/sh.debug minix-debug debug
./usr/libdata/debug/bin/sleep.debug minix-debug debug ./usr/libdata/debug/bin/sleep.debug minix-debug debug
./usr/libdata/debug/bin/stty.debug minix-debug debug ./usr/libdata/debug/bin/stty.debug minix-debug debug
@ -161,12 +161,14 @@
./usr/libdata/debug/sbin/fsck_ext2fs.debug minix-debug debug ./usr/libdata/debug/sbin/fsck_ext2fs.debug minix-debug debug
./usr/libdata/debug/sbin/fsck_mfs.debug minix-debug debug ./usr/libdata/debug/sbin/fsck_mfs.debug minix-debug debug
./usr/libdata/debug/sbin/init.debug minix-debug debug ./usr/libdata/debug/sbin/init.debug minix-debug debug
./usr/libdata/debug/sbin/minix-service.debug minix-debug debug
./usr/libdata/debug/sbin/mknod.debug minix-debug debug ./usr/libdata/debug/sbin/mknod.debug minix-debug debug
./usr/libdata/debug/sbin/newfs_ext2fs.debug minix-debug debug ./usr/libdata/debug/sbin/newfs_ext2fs.debug minix-debug debug
./usr/libdata/debug/sbin/newfs_msdos.debug minix-debug debug ./usr/libdata/debug/sbin/newfs_msdos.debug minix-debug debug
./usr/libdata/debug/sbin/newfs_udf.debug minix-debug debug ./usr/libdata/debug/sbin/newfs_udf.debug minix-debug debug
./usr/libdata/debug/sbin/newfs_v7fs.debug minix-debug debug ./usr/libdata/debug/sbin/newfs_v7fs.debug minix-debug debug
./usr/libdata/debug/sbin/ping.debug minix-debug debug ./usr/libdata/debug/sbin/ping.debug minix-debug debug
./usr/libdata/debug/sbin/printconfig.debug minix-debug debug
./usr/libdata/debug/sbin/reboot.debug minix-debug debug ./usr/libdata/debug/sbin/reboot.debug minix-debug debug
./usr/libdata/debug/sbin/shutdown.debug minix-debug debug ./usr/libdata/debug/sbin/shutdown.debug minix-debug debug
./usr/libdata/debug/sbin/sysctl.debug minix-debug debug ./usr/libdata/debug/sbin/sysctl.debug minix-debug debug

View File

@ -3405,6 +3405,7 @@
./usr/man/man8/loadramdisk.8 minix-man ./usr/man/man8/loadramdisk.8 minix-man
./usr/man/man8/makefs.8 minix-man ./usr/man/man8/makefs.8 minix-man
./usr/man/man8/makewhatis.8 minix-man ./usr/man/man8/makewhatis.8 minix-man
./usr/man/man8/minix-service.8 minix-man
./usr/man/man8/mknod.8 minix-man ./usr/man/man8/mknod.8 minix-man
./usr/man/man8/mtree.8 minix-man ./usr/man/man8/mtree.8 minix-man
./usr/man/man8/netconf.8 minix-man ./usr/man/man8/netconf.8 minix-man
@ -3436,7 +3437,7 @@
./usr/man/man8/rshd.8 minix-man ./usr/man/man8/rshd.8 minix-man
./usr/man/man8/screendump.8 minix-man ./usr/man/man8/screendump.8 minix-man
./usr/man/man8/serial-ip.8 minix-man obsolete ./usr/man/man8/serial-ip.8 minix-man obsolete
./usr/man/man8/service.8 minix-man ./usr/man/man8/service.8 minix-man obsolete
./usr/man/man8/setup.8 minix-man ./usr/man/man8/setup.8 minix-man
./usr/man/man8/shutdown.8 minix-man ./usr/man/man8/shutdown.8 minix-man
./usr/man/man8/slip.8 minix-man ./usr/man/man8/slip.8 minix-man

View File

@ -1,3 +1,18 @@
20170222:
Because of naming conflicts, the MINIX 3 service(8) utility has been
renamed to "minix-service". After successfully rebuilding the system
*and* rebooting (no earlier!), remove the old service utility:
# rm /bin/service
Better yet, use the postinstall(8) command to remove all files marked
as obsolete. It is not a bad idea to do this every now and then:
# postinstall fix obsolete
..but only ever after the reboot! Either way, deleting the old service
tool will avoid conflicts with the same-named NetBSD utility later on.
20170218: 20170218:
Before starting a build, you will have to update your master.passwd and Before starting a build, you will have to update your master.passwd and
group files in /etc. This is needed because we have switched over from group files in /etc. This is needed because we have switched over from

10
etc/rc
View File

@ -46,7 +46,7 @@ up()
service=$1 service=$1
shift shift
service $opt up /service/$service "$@" minix-service $opt up /service/$service "$@"
} }
edit() edit()
@ -72,7 +72,7 @@ edit()
if [ ! -x $binlocation ] if [ ! -x $binlocation ]
then binlocation=/sbin/$service then binlocation=/sbin/$service
fi fi
service $opt edit $binlocation -label $service "$@" minix-service $opt edit $binlocation -label $service "$@"
} }
while getopts 'saf' opt while getopts 'saf' opt
@ -174,7 +174,7 @@ autoboot|start)
rootline=`cat /etc/mtab | grep "on / "` rootline=`cat /etc/mtab | grep "on / "`
rootfs=fs_`echo "$rootline" | cut -d' ' -f1 | cut -d'/' -f3` rootfs=fs_`echo "$rootline" | cut -d' ' -f1 | cut -d'/' -f3`
roottype=`echo "$rootline" | cut -d' ' -f5` roottype=`echo "$rootline" | cut -d' ' -f5`
service -c edit /service/$roottype -label $rootfs minix-service -c edit /service/$roottype -label $rootfs
fi fi
if [ "$sflag" ] if [ "$sflag" ]
@ -224,11 +224,11 @@ down|stop)
if [ -x /service/usbd ] if [ -x /service/usbd ]
then then
service down usbd minix-service down usbd
fi fi
# Tell RS server we're going down. # Tell RS server we're going down.
service shutdown minix-service shutdown
;; ;;
esac esac

View File

@ -4,17 +4,17 @@
# TSL2550 Ambient Light Sensor # TSL2550 Ambient Light Sensor
test -e /dev/tsl2550b3s39 || (cd /dev && MAKEDEV tsl2550b3s39) test -e /dev/tsl2550b3s39 || (cd /dev && MAKEDEV tsl2550b3s39)
/bin/service up /service/tsl2550 -dev /dev/tsl2550b3s39 \ /sbin/minix-service up /service/tsl2550 -dev /dev/tsl2550b3s39 \
-label tsl2550.3.39 -args 'bus=3 address=0x39' && echo -n " tsl2550" -label tsl2550.3.39 -args 'bus=3 address=0x39' && echo -n " tsl2550"
# SHT21 Temperature and Humidity Sensor # SHT21 Temperature and Humidity Sensor
test -e /dev/sht21b3s40 || (cd /dev && MAKEDEV sht21b3s40) test -e /dev/sht21b3s40 || (cd /dev && MAKEDEV sht21b3s40)
/bin/service up /service/sht21 -dev /dev/sht21b3s40 \ /sbin/minix-service up /service/sht21 -dev /dev/sht21b3s40 \
-label sht21.3.40 -args 'bus=3 address=0x40' && echo -n " sht21" -label sht21.3.40 -args 'bus=3 address=0x40' && echo -n " sht21"
# BMP085 Temperature and Pressure Sensor # BMP085 Temperature and Pressure Sensor
test -e /dev/bmp085b3s77 || (cd /dev && MAKEDEV bmp085b3s77) test -e /dev/bmp085b3s77 || (cd /dev && MAKEDEV bmp085b3s77)
/bin/service up /service/bmp085 -dev /dev/bmp085b3s77 \ /sbin/minix-service up /service/bmp085 -dev /dev/bmp085b3s77 \
-label bmp085.3.77 -args 'bus=3 address=0x77' && echo -n " bmp085" -label bmp085.3.77 -args 'bus=3 address=0x77' && echo -n " bmp085"
daemonize tcpd http /usr/share/beaglebone/weather/weatherstation.lua daemonize tcpd http /usr/share/beaglebone/weather/weatherstation.lua

View File

@ -57,7 +57,7 @@ echo "Arguments: $@"
restarts=$(grep restarts /proc/service/$1 |cut -d: -f2) restarts=$(grep restarts /proc/service/$1 |cut -d: -f2)
restarts=$(( $restarts + 1 )) restarts=$(( $restarts + 1 ))
service down "$1" minix-service down "$1"
kill_by_name dhcpd kill_by_name dhcpd
kill_by_name nonamed kill_by_name nonamed
kill_by_name syslogd kill_by_name syslogd
@ -66,10 +66,10 @@ kill_by_name syslogd
sleep 3 sleep 3
if [ X`/bin/sysenv lwip` = Xyes ] if [ X`/bin/sysenv lwip` = Xyes ]
then then
service up /service/lwip -script /etc/rs.inet -dev /dev/ip -restarts $restarts minix-service up /service/lwip -script /etc/rs.inet -dev /dev/ip -restarts $restarts
dhcpd --lwip & dhcpd --lwip &
else else
service up /service/inet -script /etc/rs.inet -dev /dev/ip -restarts $restarts minix-service up /service/inet -script /etc/rs.inet -dev /dev/ip -restarts $restarts
daemonize dhcpd daemonize dhcpd
fi fi
daemonize nonamed -L daemonize nonamed -L

View File

@ -97,7 +97,7 @@ up()
for dir in $SERVICES_DIRS for dir in $SERVICES_DIRS
do bin=$dir/$service do bin=$dir/$service
if [ -x $bin -a -z "$found" ] if [ -x $bin -a -z "$found" ]
then service $opt up $bin "$@" then minix-service $opt up $bin "$@"
echo -n " $service" echo -n " $service"
found=yes found=yes
fi fi

View File

@ -15,13 +15,13 @@ SUBDIR= add_route arp at backup \
intr irdpd isoread \ intr irdpd isoread \
loadkeys loadramdisk logger look lp \ loadkeys loadramdisk logger look lp \
lpd lspci mail MAKEDEV \ lpd lspci mail MAKEDEV \
mount mt netconf \ minix-service mount mt netconf \
nonamed \ nonamed \
prep printroot \ prep printroot \
profile progressbar pr_routes \ profile progressbar pr_routes \
ramdisk rarpd rawspeed readclock \ ramdisk rarpd rawspeed readclock \
remsync rget rlogin \ remsync rget rlogin \
rotate service setup \ rotate setup \
slip spell sprofalyze sprofdiff srccrc \ slip spell sprofalyze sprofdiff srccrc \
svrctl swifi synctree sysenv \ svrctl swifi synctree sysenv \
tcpd tcpdp tcpstat telnet \ tcpd tcpdp tcpstat telnet \

View File

@ -9,12 +9,10 @@
#include <assert.h> #include <assert.h>
#include <signal.h> #include <signal.h>
#include <minix/dmap.h> #include <minix/dmap.h>
#include <minix/paths.h>
#include "usb_driver.h" #include "usb_driver.h"
#include "proto.h" #include "proto.h"
#define SERVICE_BINARY "/bin/service"
#define DEVMAN_TYPE_NAME "dev_type" #define DEVMAN_TYPE_NAME "dev_type"
#define PATH_LEN 256 #define PATH_LEN 256
#define INVAL_MAJOR -1 #define INVAL_MAJOR -1
@ -166,8 +164,8 @@ int stop_driver(struct devmand_driver_instance *inst)
assert(inst->label); assert(inst->label);
snprintf(cmdl, 1024, "%s down %s %d", snprintf(cmdl, 1024, "%s down %s %d",
SERVICE_BINARY, inst->label, inst->dev_id); _PATH_MINIX_SERVICE, inst->label, inst->dev_id);
dbg("executing service: \"%s\"", cmdl); dbg("executing minix-service: \"%s\"", cmdl);
ret = system(cmdl); ret = system(cmdl);
if (ret != 0) if (ret != 0)
{ {
@ -201,9 +199,9 @@ int start_driver(struct devmand_driver_instance *inst)
assert(inst->label); assert(inst->label);
snprintf(cmdl, 1024, "%s up %s -major %d -devid %d -label %s", snprintf(cmdl, 1024, "%s up %s -major %d -devid %d -label %s",
SERVICE_BINARY, inst->drv->binary, inst->major, inst->dev_id, _PATH_MINIX_SERVICE, inst->drv->binary, inst->major, inst->dev_id,
inst->label); inst->label);
dbg("executing service: \"%s\"", cmdl); dbg("executing minix-service: \"%s\"", cmdl);
ret = system(cmdl); ret = system(cmdl);
@ -739,7 +737,7 @@ static void usb_intf_add_event(char *path, int dev_id)
drv_inst->dev_id = dev_id; drv_inst->dev_id = dev_id;
/* start driver (invoke service) */ /* start driver (invoke minix-service) */
start_driver(drv_inst); start_driver(drv_inst);
/* /*

View File

@ -0,0 +1,10 @@
# Makefile for minix-service
PROGS= minix-service printconfig
SRCS.minix-service=minix-service.c parse.c util.c
SRCS.printconfig=print.c parse.c util.c
BINDIR= /sbin
MAN.minix-service= minix-service.8 system.conf.5
MAN.printconfig=
.include <bsd.prog.mk>

View File

@ -1,24 +1,24 @@
.TH SERVICE 8 .TH MINIX-SERVICE 8
.SH NAME .SH NAME
service \- Manage an operating system service. minix-service \- Manage an operating system service.
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\fBservice [-b -c -n -p -r] (up|run|edit|update)\fR \fI<binary|self>\fR \fBminix-service [-b -c -n -p -r] (up|run|edit|update)\fR \fI<binary|self>\fR
[\fB-args\fR \fI<args>\fR] [\fB-dev\fR \fI<special>\fR] [\fB-args\fR \fI<args>\fR] [\fB-dev\fR \fI<special>\fR]
[\fB-period\fR \fI<ticks>\fR] [\fB-period\fR \fI<ticks>\fR]
[\fB-script\fR \fI<path>\fR] [\fB-label\fR \fI<name>\fR] [\fB-script\fR \fI<path>\fR] [\fB-label\fR \fI<name>\fR]
[\fB-config\fR \fI<path>\fR] [\fB-state\fR \fI<state>\fR] [\fB-config\fR \fI<path>\fR] [\fB-state\fR \fI<state>\fR]
[\fB-maxtime\fR \fI<time>\fR] [\fB-maxtime\fR \fI<time>\fR]
.PP .PP
\fBservice down\fR \fI<label>\fR \fBminix-service down\fR \fI<label>\fR
.PP .PP
\fBservice refresh\fR \fI<label>\fR \fBminix-service refresh\fR \fI<label>\fR
.PP .PP
\fBservice restart\fR \fI<label>\fR \fBminix-service restart\fR \fI<label>\fR
.PP .PP
\fBservice clone\fR \fI<label>\fR \fBminix-service clone\fR \fI<label>\fR
.PP .PP
\fBservice shutdown\fR \fBminix-service shutdown\fR
.br .br
.de FL .de FL
.TP .TP
@ -32,7 +32,7 @@ service \- Manage an operating system service.
.. ..
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \fBservice\fR utility instructs the reincarnation server (\fBRS\fR) The \fBminix-service\fR utility instructs the reincarnation server (\fBRS\fR)
to perform an action for a given system service (an OS server to perform an action for a given system service (an OS server
or device driver). The action may concern an existing system service or device driver). The action may concern an existing system service
(SHIFT+F6 to list them all), or a new system service to be started (SHIFT+F6 to list them all), or a new system service to be started
@ -51,7 +51,7 @@ or device driver). The action may concern an existing system service
.SH ACTIONS .SH ACTIONS
.PP .PP
.SS .SS
\fBservice up\fR \fI<binary>\fR \fBminix-service up\fR \fI<binary>\fR
.PP .PP
.PP .PP
Starts a new system service identified by the given \fI<binary>\fR, Starts a new system service identified by the given \fI<binary>\fR,
@ -133,20 +133,20 @@ for the syntax to use in the system configuration file.
The default is to use the global system configuration file \fB/etc/system.conf\fR. The default is to use the global system configuration file \fB/etc/system.conf\fR.
.PP .PP
.SS .SS
\fBservice run\fR \fI<binary>\fR \fBminix-service run\fR \fI<binary>\fR
.PP .PP
.PP .PP
Runs a new system service identified by the given \fI<binary>\fR, Runs a new system service identified by the given \fI<binary>\fR,
which must be specified using an absolute path. Similar to which must be specified using an absolute path. Similar to
\fBservice up\fR \fI<binary>\fR, but instructs \fBRS\fR not to \fBminix-service up\fR \fI<binary>\fR, but instructs \fBRS\fR not to
restart the service upon termination. This action is currently a shorthand restart the service upon termination. This action is currently a shorthand
for \fBservice up\fR \fI<binary>\fR \fB-script\fR \fI/etc/rs.single\fR, which for \fBminix-service up\fR \fI<binary>\fR \fB-script\fR \fI/etc/rs.single\fR,
uses a recovery script that simply brings down the service upon termination. which uses a recovery script that simply brings down the service upon
This action should be only used for short-lived programs that need system termination. This action should be only used for short-lived programs that need
service privileges and do not require crash recovery support. system service privileges and do not require crash recovery support.
.PP .PP
.SS .SS
\fBservice edit\fR \fI<binary>\fR [\fB-label\fR \fI<name>\fR] \fBminix-service edit\fR \fI<binary>\fR [\fB-label\fR \fI<name>\fR]
.PP .PP
.PP .PP
Edits settings of an existing system service identified by the given Edits settings of an existing system service identified by the given
@ -158,7 +158,7 @@ associated to the service will no be updated. This
action takes the same options supported by the \fBup\fR action. action takes the same options supported by the \fBup\fR action.
.PP .PP
.SS .SS
\fBservice update\fR \fI<binary|self>\fR \fBminix-service update\fR \fI<binary|self>\fR
.PP .PP
.PP .PP
Live updates an existing system service with a new version identified by the Live updates an existing system service with a new version identified by the
@ -182,7 +182,7 @@ specifies the maximum amount time for the service to prepare
for the update. The default is 0 (unlimited). for the update. The default is 0 (unlimited).
.PP .PP
.SS .SS
\fBservice down\fR \fI<label>\fR \fBminix-service down\fR \fI<label>\fR
.PP .PP
.PP .PP
Stops an existing system service identified by the given \fI<label>\fR. \fBRS\fR Stops an existing system service identified by the given \fI<label>\fR. \fBRS\fR
@ -190,28 +190,28 @@ will bring down the service without attempting to restart it. Critical system
services cannot be shut down. services cannot be shut down.
.PP .PP
.SS .SS
\fBservice refresh\fR \fI<label>\fR \fBminix-service refresh\fR \fI<label>\fR
.PP .PP
.PP .PP
Refreshes an existing system service identified by the given \fI<label>\fR. Refreshes an existing system service identified by the given \fI<label>\fR.
\fBRS\fR will kill the service and attempt to restart it. \fBRS\fR will kill the service and attempt to restart it.
.PP .PP
.SS .SS
\fBservice restart\fR \fI<label>\fR \fBminix-service restart\fR \fI<label>\fR
.PP .PP
.PP .PP
Restarts an existing terminated system service identified by the Restarts an existing terminated system service identified by the
given \fI<label>\fR. This action can only be used from a recovery script. given \fI<label>\fR. This action can only be used from a recovery script.
.PP .PP
.SS .SS
\fBservice clone\fR \fI<label>\fR \fBminix-service clone\fR \fI<label>\fR
.PP .PP
.PP .PP
Clones an existing system service to create a replica \fBRS\fR will use Clones an existing system service to create a replica \fBRS\fR will use
to restart the service upon termination. to restart the service upon termination.
.PP .PP
.SS .SS
\fBservice shutdown\fR \fBminix-service shutdown\fR
.PP .PP
.PP .PP
Tells \fBRS\fR the system is about to shutdown and no system service should Tells \fBRS\fR the system is about to shutdown and no system service should
@ -219,15 +219,15 @@ be restarted upon termination.
.PP .PP
.SH EXAMPLES .SH EXAMPLES
.TP 20 .TP 20
.B service up /sbin/is -period 5HZ .B minix-service up /sbin/is -period 5HZ
# Start the IS server and check its status every 5 seconds. # Start the IS server and check its status every 5 seconds.
.br .br
.TP 20 .TP 20
.B service up /usr/sbin/dp8390 -args DPETH0=pci .B minix-service up /usr/sbin/dp8390 -args DPETH0=pci
# Start the DP8390 ethernet driver, passing one argument. # Start the DP8390 ethernet driver, passing one argument.
.br .br
.TP 20 .TP 20
.B service down lance .B minix-service down lance
# Stop the system service with label lance. # Stop the system service with label lance.
.br .br
.SH "SEE ALSO" .SH "SEE ALSO"

View File

@ -1117,8 +1117,8 @@ static const char *do_config(const char *label, char *filename, struct rs_config
} }
if (cp == NULL) if (cp == NULL)
{ {
fprintf(stderr, "service: service '%s' not found in '%s'\n", fprintf(stderr, "minix-service: service '%s' not found in "
label, filename); "'%s'\n", label, filename);
exit(1); exit(1);
} }

View File

@ -12,9 +12,9 @@ The file
.B /etc/system.conf .B /etc/system.conf
is the global system configuration file that contains the is the global system configuration file that contains the
configuration for all the primary system services. This is the file configuration for all the primary system services. This is the file
that the \fBservice\fR utility uses by default. Custom configuration that the \fBminix-service\fR utility uses by default. Custom configuration
files with the same format can be specified on a per-service basis. See files with the same format can be specified on a per-service basis. See
.BR service (8) .BR minix-service (8)
for more details. for more details.
This page is a summary of all the elements that can be found in this This page is a summary of all the elements that can be found in this
@ -23,8 +23,8 @@ configuration file.
The syntax used is that of the common configuration file described in The syntax used is that of the common configuration file described in
.BR configfile (5). .BR configfile (5).
.PP .PP
The \fBservice\fR utility scans the configuration file from beginning to end The \fBminix-service\fR utility scans the configuration file from beginning to
to gather information about a specific system service when starting or end to gather information about a specific system service when starting or
updating the properties of a service. updating the properties of a service.
The file contains a collection of service entries of the form: The file contains a collection of service entries of the form:
@ -47,7 +47,7 @@ be used:
.RS .RS
specifies the user id or the user name to use to run the system service. specifies the user id or the user name to use to run the system service.
\fISELF\fR can be used when the service has to start with the realuid of \fISELF\fR can be used when the service has to start with the realuid of
the user who's executing the \fBservice\fR utility. the user who's executing the \fBminix-service\fR utility.
Many system services run with root privileges (uid \fB0\fR). Many system services run with root privileges (uid \fB0\fR).
The default user is service (uid \fB12\fR). The default user is service (uid \fB12\fR).
.RE .RE
@ -174,7 +174,7 @@ The default is to allow no controller services.
.PP .PP
.SH "SEE ALSO" .SH "SEE ALSO"
.BR configfile (5), .BR configfile (5),
.BR service (8), .BR minix-service (8),
.BR boot (8). .BR boot (8).
.SH AUTHOR .SH AUTHOR
Cristiano Giuffrida <giuffrida@cs.vu.nl> Cristiano Giuffrida <giuffrida@cs.vu.nl>

View File

@ -7,7 +7,7 @@ void fatal(char *fmt, ...)
{ {
va_list ap; va_list ap;
fprintf(stderr, "service: fatal error: "); fprintf(stderr, "minix-service: fatal error: ");
va_start(ap, fmt); va_start(ap, fmt);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
va_end(ap); va_end(ap);
@ -20,7 +20,7 @@ void warning(char *fmt, ...)
{ {
va_list ap; va_list ap;
fprintf(stderr, "service: warning: "); fprintf(stderr, "minix-service: warning: ");
va_start(ap, fmt); va_start(ap, fmt);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
va_end(ap); va_end(ap);

View File

@ -1,10 +0,0 @@
# Makefile for service
PROGS= service printconfig
SRCS.service=service.c parse.c util.c
SRCS.printconfig=print.c parse.c util.c
BINDIR= /bin
MAN.service= service.8 system.conf.5
MAN.printconfig=
.include <bsd.prog.mk>

View File

@ -2,4 +2,4 @@
# 'Recovery' script immediately restarts. # 'Recovery' script immediately restarts.
echo "Arguments: $@" >/dev/console echo "Arguments: $@" >/dev/console
service restart "$1" minix-service restart "$1"

View File

@ -9,7 +9,7 @@ EXE=$EXEDIR/$NAME
start_driver() start_driver()
{ {
service up $EXE -label $LABEL -script /etc/rs.single -period 3HZ minix-service up $EXE -label $LABEL -script /etc/rs.single -period 3HZ
} }
do_one() do_one()
@ -51,7 +51,7 @@ one_round()
} }
# Start our own driver. # Start our own driver.
service down $LABEL minix-service down $LABEL
sleep 10 # Allow driver to die sleep 10 # Allow driver to die
start_driver start_driver

View File

@ -101,9 +101,9 @@ random)
esac esac
# Start our own driver. # Start our own driver.
service down $LABEL minix-service down $LABEL
sleep 2 # Allow driver to die sleep 2 # Allow driver to die
service up $EXE -script `pwd`/rs.restart_imm -period 3HZ $DEV minix-service up $EXE -script `pwd`/rs.restart_imm -period 3HZ $DEV
i=0 i=0
while [ $i -lt "$count" ] while [ $i -lt "$count" ]
@ -119,4 +119,4 @@ do
done done
# Restart the driver # Restart the driver
service refresh $LABEL minix-service refresh $LABEL

View File

@ -121,9 +121,9 @@ random)
esac esac
# Start our own driver. # Start our own driver.
service down $LABEL minix-service down $LABEL
sleep 10 # Allow driver to die sleep 10 # Allow driver to die
service up $EXE -script `pwd`/rs.restart_imm -period 3HZ minix-service up $EXE -script `pwd`/rs.restart_imm -period 3HZ
i=0 i=0
while [ $i -lt "$count" ] while [ $i -lt "$count" ]
@ -143,4 +143,4 @@ echo "driver crashed after $fault_blocks blocks"
echo "driver failed to connect after $connect_blocks blocks" echo "driver failed to connect after $connect_blocks blocks"
# Restart the driver # Restart the driver
service refresh $LABEL minix-service refresh $LABEL

View File

@ -35,7 +35,7 @@ The following options are available:
Enable verbose mode. Enable verbose mode.
.El .El
.Sh SEE ALSO .Sh SEE ALSO
.Xr service 8 .Xr minix-service 8
.Sh AUTHORS .Sh AUTHORS
The The
.Nm .Nm

View File

@ -25,8 +25,8 @@ SKIP="memory vm"
STATES="vfs:2 ahci_:2 virtio_blk_:2" STATES="vfs:2 ahci_:2 virtio_blk_:2"
# If this variable is set, it is used as timeout for the live updates. The # If this variable is set, it is used as timeout for the live updates. The
# service(8) argument takes a number of click ticks, or a number of seconds # minix-service(8) argument takes a number of click ticks, or a number of
# if the value ends with "HZ". # seconds if the value ends with "HZ".
TIMEOUT=300HZ TIMEOUT=300HZ
# Configuration ends here. # Configuration ends here.
@ -122,7 +122,7 @@ for service in $services; do
# Perform the live update. The update may legitimately fail if the # Perform the live update. The update may legitimately fail if the
# service is not in the right state. TODO: report transient errors # service is not in the right state. TODO: report transient errors
# as debugging output only. # as debugging output only.
service -a update $binary -progname $filename -label $label \ minix-service -a update $binary -progname $filename -label $label \
-asr-count $count $state $maxtime -asr-count $count $state $maxtime
error=$? error=$?
if [ $error -eq 0 ]; then if [ $error -eq 0 ]; then

View File

@ -6,4 +6,4 @@ es1371/ ES1371 driver
sb16/ SB16 ISA driver sb16/ SB16 ISA driver
Running the drivers: Running the drivers:
* service up /service/es137{0,1} -dev /dev/audio * minix-service up /service/es137{0,1} -dev /dev/audio

View File

@ -11,8 +11,8 @@ Installation instructions SB16 driver Minix >= 3.0.7
(default 7 and 220) (default 7 and 220)
- make install - make install
- MAKEDEV /dev/audio (if /dev/audio doesn't allready exist) - MAKEDEV /dev/audio (if /dev/audio doesn't allready exist)
- service up /service/sb16_dsp -dev /dev/audio - minix-service up /service/sb16_dsp -dev /dev/audio
- service up /service/sb16_mixer -dev /dev/mixer - minix-service up /service/sb16_mixer -dev /dev/mixer
done... (you can include the last 2 lines in /usr/etc/rc) done... (you can include the last 2 lines in /usr/etc/rc)

View File

@ -33,9 +33,9 @@ cd /dev && MAKEDEV i2c-1 && MAKEDEV i2c-2 && MAKEDEV i2c-3
Starting up the instances: Starting up the instances:
/bin/service up /service/i2c -dev /dev/i2c-1 -label i2c.1 -args instance=1 /sbin/minix-service up /service/i2c -dev /dev/i2c-1 -label i2c.1 -args instance=1
/bin/service up /service/i2c -dev /dev/i2c-2 -label i2c.2 -args instance=2 /sbin/minix-service up /service/i2c -dev /dev/i2c-2 -label i2c.2 -args instance=2
/bin/service up /service/i2c -dev /dev/i2c-3 -label i2c.3 -args instance=3 /sbin/minix-service up /service/i2c -dev /dev/i2c-3 -label i2c.3 -args instance=3
There is an i2cscan program from NetBSD which can detect devices on the bus: There is an i2cscan program from NetBSD which can detect devices on the bus:

View File

@ -12,5 +12,5 @@ Testing the Code
Starting up an instance: Starting up an instance:
/bin/service up /service/cat24c256 -dev /dev/eepromb1s50 -label cat24c256.1.50 -args 'bus=1 address=0x50' /sbin/minix-service up /service/cat24c256 -dev /dev/eepromb1s50 -label cat24c256.1.50 -args 'bus=1 address=0x50'

View File

@ -12,9 +12,9 @@ Testing the Code
Starting up an instance: Starting up an instance:
/bin/service up /usr/sbin/tps65217 -label tps65217.1.24 \ /sbin/minix-service up /usr/sbin/tps65217 -label tps65217.1.24 \
-args 'bus=1 address=0x24' -args 'bus=1 address=0x24'
Killing an instance: Killing an instance:
/bin/service down tps65217.1.24 /sbin/minix-service down tps65217.1.24

View File

@ -28,9 +28,9 @@ Testing the Code
Starting up an instance: Starting up an instance:
/bin/service up /service/tps65950 -label tps65950.1.48 \ /sbin/minix-service up /service/tps65950 -label tps65950.1.48 \
-args 'bus=1 address=0x48' -args 'bus=1 address=0x48'
Killing an instance: Killing an instance:
/bin/service down tps65950.1.48 /sbin/minix-service down tps65950.1.48

View File

@ -30,9 +30,9 @@ Limitations
The measurement resolution is configurable in the chip, but this driver just The measurement resolution is configurable in the chip, but this driver just
uses standard mode. It could probably be implemented with an ioctl() or by uses standard mode. It could probably be implemented with an ioctl() or by
passing an argument via the service command, but it doesn't seem too useful at passing an argument via the minix-service command, but it doesn't seem too
this time. See the data sheet for the trade-offs between conversion time, useful at this time. See the data sheet for the trade-offs between conversion
power consumption, and resolution. time, power consumption, and resolution.
While only the BMP085 is supported at present, the BMP085's predecessor, While only the BMP085 is supported at present, the BMP085's predecessor,
SMD500, should be easy to support in this driver with some small changes SMD500, should be easy to support in this driver with some small changes
@ -50,8 +50,8 @@ The driver should have been started by a script in /etc/rc.capes/ If not,
this is how you start up an instance: this is how you start up an instance:
cd /dev && MAKEDEV bmp085b3s77 cd /dev && MAKEDEV bmp085b3s77
/bin/service up /service/bmp085 -label bmp085.3.77 -dev /dev/bmp085b3s77 \ /sbin/minix-service up /service/bmp085 -label bmp085.3.77 \
-args 'bus=3 address=0x77' -dev /dev/bmp085b3s77 -args 'bus=3 address=0x77'
Getting the sensor value: Getting the sensor value:
@ -59,5 +59,5 @@ cat /dev/bmp085b3s77
Killing an instance: Killing an instance:
/bin/service down bmp085.3.77 /sbin/minix-service down bmp085.3.77

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -35,9 +35,9 @@ second will return cached temperature and humidity values.
The measurement resolution is configurable in the chip, but this driver just The measurement resolution is configurable in the chip, but this driver just
uses the default maximum resolutions (12-bit for Humidity, 14-bit for uses the default maximum resolutions (12-bit for Humidity, 14-bit for
temperature). It could probably be implemented with an ioctl() or by passing temperature). It could probably be implemented with an ioctl() or by passing
an argument via the service command, but it doesn't seem too useful at this an argument via the minix-service command, but it doesn't seem too useful at
time. See the data sheet for the trade-off between faster conversion time and this time. See the data sheet for the trade-off between faster conversion time
lower resolution. and lower resolution.
In testing, the temperature sensor reported a value several degrees higher In testing, the temperature sensor reported a value several degrees higher
than an indoor thermometer placed nearby. It doesn't appear to be a bug in the than an indoor thermometer placed nearby. It doesn't appear to be a bug in the
@ -54,7 +54,7 @@ The driver should have been started by a script in /etc/rc.capes/ If not,
this is how you start up an instance: this is how you start up an instance:
cd /dev && MAKEDEV sht21b3s40 cd /dev && MAKEDEV sht21b3s40
/bin/service up /service/sht21 -label sht21.3.40 -dev /dev/sht21b3s40 \ /sbin/minix-service up /service/sht21 -label sht21.3.40 -dev /dev/sht21b3s40 \
-args 'bus=3 address=0x40' -args 'bus=3 address=0x40'
Getting the sensor value: Getting the sensor value:
@ -63,5 +63,5 @@ cat /dev/sht21b3s40
Killing an instance: Killing an instance:
/bin/service down sht21.3.40 /sbin/minix-service down sht21.3.40

View File

@ -33,8 +33,8 @@ The driver should have been started by a script in /etc/rc.capes/ If not,
this is how you start up an instance: this is how you start up an instance:
cd /dev && MAKEDEV tsl2550b3s39 cd /dev && MAKEDEV tsl2550b3s39
/bin/service up /service/tsl2550 -label tsl2550.3.39 -dev /dev/tsl2550b3s39 \ /sbin/minix-service up /service/tsl2550 -label tsl2550.3.39 \
-args 'bus=3 address=0x39' -dev /dev/tsl2550b3s39 -args 'bus=3 address=0x39'
Getting the sensor value: Getting the sensor value:
@ -42,5 +42,5 @@ cat /dev/tsl2550b3s39
Killing an instance: Killing an instance:
/bin/service down tsl2550.3.39 /sbin/minix-service down tsl2550.3.39

View File

@ -4,7 +4,7 @@ driver (mmcblk.c).
* Mini how-to * Mini how-to
On the BeagleBone Black, the block device files /dev/c1d* (major = 8) are free. On the BeagleBone Black, the block device files /dev/c1d* (major = 8) are free.
The driver can use /dev/c1d0. The driver can use /dev/c1d0.
# service up /service/emmc -dev /dev/c1d0 # minix-service up /service/emmc -dev /dev/c1d0
* Programmed Input/Output * Programmed Input/Output
The driver does not have support for DMA. The driver does not have support for DMA.
@ -20,4 +20,4 @@ AM335x Sitara Processors Technical Reference Manual. Literature number: SPRUH73L
Embedded MultiMediaCard Product Standard (MMCA, 4.41). Document number: JESD84-A441 Embedded MultiMediaCard Product Standard (MMCA, 4.41). Document number: JESD84-A441
AM335x Sitara Processors Datasheet. Literature number: SPRS717F AM335x Sitara Processors Datasheet. Literature number: SPRS717F
OMAP35x Applications Processor Technical Reference Manual. Literature number: SPRUF98X OMAP35x Applications Processor Technical Reference Manual. Literature number: SPRUF98X
MINIX 3 MMC/SD source code. MINIX 3 MMC/SD source code.

View File

@ -96,9 +96,10 @@ apply_env()
/* apply the env setting passed to this driver parameters accepted /* apply the env setting passed to this driver parameters accepted
* log_level=[0-4] (NONE,WARN,INFO,DEBUG,TRACE) instance=[0-3] * log_level=[0-4] (NONE,WARN,INFO,DEBUG,TRACE) instance=[0-3]
* instance/bus number to use for this driver Passing these arguments * instance/bus number to use for this driver Passing these arguments
* is done when starting the driver using the service command in the * is done when starting the driver using the minix-service command in
* following way service up /service/mmc -args "log_level=2 instance=1 * the following way:
* driver=dummy" -dev /dev/c2d0 */ * minix-service up /service/mmc -args "log_level=2 instance=1
* driver=dummy" -dev /dev/c2d0 */
char driver[16]; char driver[16];
memset(driver, '\0', 16); memset(driver, '\0', 16);
(void) env_get_param("driver", driver, 16); (void) env_get_param("driver", driver, 16);

View File

@ -45,8 +45,8 @@ PROGRAMS+= mount
dir.mount:= minix/commands/mount dir.mount:= minix/commands/mount
PROGRAMS+= procfs PROGRAMS+= procfs
dir.procfs:= minix/fs/procfs dir.procfs:= minix/fs/procfs
PROGRAMS+= service PROGRAMS+= minix-service
dir.service:= minix/commands/service dir.minix-service:= minix/commands/minix-service
PROGRAMS+= sh PROGRAMS+= sh
dir.sh:= bin/sh dir.sh:= bin/sh
PROGRAMS+= sysenv PROGRAMS+= sysenv

View File

@ -13,7 +13,9 @@ d--755 0 0
umount ---755 0 0 umount umount ---755 0 0 umount
grep ---755 0 0 grep grep ---755 0 0 grep
sh ---755 0 0 sh sh ---755 0 0 sh
service ---755 0 0 service $
sbin d--755 0 0
minix-service ---755 0 0 minix-service
$ $
service d--755 0 0 service d--755 0 0
#ifdef __i386__ #ifdef __i386__

View File

@ -5,18 +5,20 @@ exec >/dev/log
exec 2>/dev/log exec 2>/dev/log
exec </dev/null exec </dev/null
PATH=/sbin:/usr/sbin:/bin:/usr/bin
FSCK=/bin/fsck_mfs FSCK=/bin/fsck_mfs
ACPI=/service/acpi ACPI=/service/acpi
if [ X`/bin/sysenv arch` = Xi386 ] if [ X`/bin/sysenv arch` = Xi386 ]
then if [ -e $ACPI -a -n "`sysenv acpi`" ] then if [ -e $ACPI -a -n "`sysenv acpi`" ]
then then
/bin/service -c up $ACPI minix-service -c up $ACPI
fi fi
/bin/service -c up /service/pci -dev /dev/pci minix-service -c up /service/pci -dev /dev/pci
/bin/service -c up /service/input -dev /dev/kbdmux minix-service -c up /service/input -dev /dev/kbdmux
/bin/service -c up /service/pckbd || : minix-service -c up /service/pckbd || :
# Start procfs so we can access /proc/pci # Start procfs so we can access /proc/pci
mount -t procfs none /proc >/dev/null mount -t procfs none /proc >/dev/null
@ -30,27 +32,27 @@ then if [ -e $ACPI -a -n "`sysenv acpi`" ]
virtio_blk=yes virtio_blk=yes
fi fi
/bin/service -cn up /service/floppy -dev /dev/fd0 minix-service -cn up /service/floppy -dev /dev/fd0
if [ X`/bin/sysenv ahci` = Xyes ] if [ X`/bin/sysenv ahci` = Xyes ]
then then
# this is here temporarily, for testing purposes # this is here temporarily, for testing purposes
/bin/service -c up /service/ahci -dev /dev/c0d0 -label ahci_0 -args instance=0 minix-service -c up /service/ahci -dev /dev/c0d0 -label ahci_0 -args instance=0
elif [ X"$virtio_blk" = Xyes ] elif [ X"$virtio_blk" = Xyes ]
then then
/bin/service -c up /service/virtio_blk -dev /dev/c0d0 -label virtio_blk_0 -args instance=0 minix-service -c up /service/virtio_blk -dev /dev/c0d0 -label virtio_blk_0 -args instance=0
else else
/bin/service -c up /service/at_wini -dev /dev/c0d0 -label at_wini_0 minix-service -c up /service/at_wini -dev /dev/c0d0 -label at_wini_0
/bin/service -cr up /service/at_wini -dev /dev/c1d0 -label at_wini_1 -args instance=1 2>/dev/null || : minix-service -cr up /service/at_wini -dev /dev/c1d0 -label at_wini_1 -args instance=1 2>/dev/null || :
fi fi
/bin/umount /proc >/dev/null /bin/umount /proc >/dev/null
fi fi
if [ X`/bin/sysenv arch` = Xearm ] if [ X`/bin/sysenv arch` = Xearm ]
then echo Starting the mmc driver then echo Starting the mmc driver
/bin/service -c up /service/mmc -dev /dev/c0d0 minix-service -c up /service/mmc -dev /dev/c0d0
fi fi
/bin/service up /service/procfs || echo "WARNING: couldn't start procfs" minix-service up /service/procfs || echo "WARNING: couldn't start procfs"
if /bin/sysenv rootdevname >/dev/null if /bin/sysenv rootdevname >/dev/null
then rootdevname=/dev/`/bin/sysenv rootdevname` then rootdevname=/dev/`/bin/sysenv rootdevname`

View File

@ -12,7 +12,7 @@ Testing the Code
Starting up an instance: Starting up an instance:
service up /service/fb -dev /dev/fb0 -args edid.0=cat24c256.3.50 minix-service up /service/fb -dev /dev/fb0 -args edid.0=cat24c256.3.50
The arguments take the following form: The arguments take the following form:

View File

@ -45,11 +45,11 @@ static struct log log = {
static char edid_providers[FB_DEV_NR][RS_MAX_LABEL_LEN+1]; static char edid_providers[FB_DEV_NR][RS_MAX_LABEL_LEN+1];
/* /*
* Populate edid_providers from command line arguments. The service command * Populate edid_providers from command line arguments. The minix-service
* should get EDID providers like this: "-args edid.0=tda19988.1.3470" where * command should get EDID providers like this: "-args edid.0=tda19988.1.3470"
* 0 is the minor number of the frame buffer, tda19988 is the device driver, * where 0 is the minor number of the frame buffer, tda19988 is the device
* 1 is the i2c bus and 3470 is the slave address (the TDA19988 has 2 slave * driver, 1 is the i2c bus and 3470 is the slave address (the TDA19988 has 2
* addresses 0x34 and 0x70). * slave addresses 0x34 and 0x70).
*/ */
int int
fb_edid_args_parse(void) fb_edid_args_parse(void)

View File

@ -52,12 +52,12 @@ Testing the Code
Starting up an instance: Starting up an instance:
/bin/service up /service/tda19988 -label tda19988.1.3470 \ /sbin/minix-service up /service/tda19988 -label tda19988.1.3470 \
-args 'cec_bus=1 cec_address=0x34 hdmi_bus=1 hdmi_address=0x70' -args 'cec_bus=1 cec_address=0x34 hdmi_bus=1 hdmi_address=0x70'
Killing an instance: Killing an instance:
/bin/service down tda19988.1.3470 /sbin/minix-service down tda19988.1.3470
The driver is meant to be accessed from other drivers using the block The driver is meant to be accessed from other drivers using the block
device protocol, so it doesn't have a reserved major number and device file. device protocol, so it doesn't have a reserved major number and device file.
@ -67,11 +67,11 @@ device file to read the EDID like this:
cd /dev cd /dev
mknod tda19988 b 32 0 mknod tda19988 b 32 0
chmod 600 tda19988 chmod 600 tda19988
/bin/service up /service/tda19988 -label tda19988.1.3470 \ /sbin/minix-service up /service/tda19988 -label tda19988.1.3470 \
-dev /dev/tda19988 \ -dev /dev/tda19988 \
-args 'cec_bus=1 cec_address=0x34 hdmi_bus=1 hdmi_address=0x70' -args 'cec_bus=1 cec_address=0x34 hdmi_bus=1 hdmi_address=0x70'
dd if=/dev/tda19988 of=/root/edid.dat count=1 bs=128 dd if=/dev/tda19988 of=/root/edid.dat count=1 bs=128
/bin/service down tda19988.1.3470 /sbin/minix-service down tda19988.1.3470
hexdump -C /root/edid.dat hexdump -C /root/edid.dat
rm tda19988 rm tda19988

View File

@ -1,7 +1,7 @@
#ifndef _MINIX_PATHS_H_ #ifndef _MINIX_PATHS_H_
#define _MINIX_PATHS_H_ #define _MINIX_PATHS_H_
#define _PATH_SERVICE "/bin/service" #define _PATH_MINIX_SERVICE "/sbin/minix-service"
#define _PATH_PROC "/proc/" #define _PATH_PROC "/proc/"
#define _PATH_SYSTEM_CONF "/etc/system.conf" #define _PATH_SYSTEM_CONF "/etc/system.conf"

View File

@ -20,9 +20,9 @@ static char fspath[] = "/service/:/usr/pkg/service/"; /* Must include trailing '
static int rs_down(char *label) static int rs_down(char *label)
{ {
char cmd[200]; char cmd[200];
if(strlen(_PATH_SERVICE)+strlen(label)+50 >= sizeof(cmd)) if(strlen(_PATH_MINIX_SERVICE)+strlen(label)+50 >= sizeof(cmd))
return -1; return -1;
sprintf(cmd, _PATH_SERVICE " down '%s'", label); sprintf(cmd, _PATH_MINIX_SERVICE " down '%s'", label);
return system(cmd); return system(cmd);
} }
@ -125,13 +125,14 @@ int minix_mount(char *special, char *name, int mountflags, int srvflags,
return(-1); return(-1);
} }
if (strlen(_PATH_SERVICE) + strlen(path) + strlen(label) + if (strlen(_PATH_MINIX_SERVICE) + strlen(path) + strlen(label) +
strlen(args) + 50 >= sizeof(cmd)) { strlen(args) + 50 >= sizeof(cmd)) {
errno = E2BIG; errno = E2BIG;
return -1; return -1;
} }
sprintf(cmd, _PATH_SERVICE " %sup %s -label '%s' -args '%s %s %s%s'", sprintf(cmd, _PATH_MINIX_SERVICE
" %sup %s -label '%s' -args '%s %s %s%s'",
reuse ? "-r ": "", path, label, special, name, reuse ? "-r ": "", path, label, special, name,
args[0] ? "-o " : "", args); args[0] ? "-o " : "", args);

View File

@ -14,6 +14,6 @@ block_test() {
if [ ! -b "$1" ]; then echo "$1 is not a block device" >&2; exit 1; fi if [ ! -b "$1" ]; then echo "$1 is not a block device" >&2; exit 1; fi
pair=$(devtopair $1) pair=$(devtopair $1)
if [ -z "$pair" ]; then echo "driver not found for $1" >&2; exit 1; fi if [ -z "$pair" ]; then echo "driver not found for $1" >&2; exit 1; fi
service up `pwd`/blocktest -args "$pair,$2" -config system.conf \ minix-service up `pwd`/blocktest -args "$pair,$2" -config system.conf \
-script /etc/rs.single -label blocktest_$(stat -f '%r' $1) -script /etc/rs.single -label blocktest_$(stat -f '%r' $1)
} }

View File

@ -6,7 +6,7 @@
# runs the ddekit driver on the given device with the given parameters # runs the ddekit driver on the given device with the given parameters
run_ddekittest () { run_ddekittest () {
if [ ! -x ddekittest_driver ]; then echo "compile ddekittest first!" >&2; exit 1; fi if [ ! -x ddekittest_driver ]; then echo "compile ddekittest first!" >&2; exit 1; fi
service up `pwd`/ddekittest_driver -config system.conf \ minix-service up `pwd`/ddekittest_driver -config system.conf \
-script /etc/rs.single -label ddekittest -script /etc/rs.single -label ddekittest
} }
@ -16,4 +16,4 @@ run_ddekittest () {
# #
run_ddekittest run_ddekittest
sleep 10 sleep 10
service down ddekittest minix-service down ddekittest

View File

@ -2,6 +2,6 @@
PWD=`pwd` PWD=`pwd`
service up ${PWD}/subs -config system.conf -script /etc/rs.single minix-service up ${PWD}/subs -config system.conf -script /etc/rs.single
service up ${PWD}/dstest -config system.conf -script /etc/rs.single minix-service up ${PWD}/dstest -config system.conf -script /etc/rs.single
service down subs minix-service down subs

View File

@ -82,11 +82,11 @@ read_test() {
EXP=$2 EXP=$2
shift 2 shift 2
$RWBLOCKS $DEV $PAT $RWBLOCKS $DEV $PAT
service up /service/fbd -dev /dev/fbd -args "$PAIR" || exit 1 minix-service up /service/fbd -dev /dev/fbd -args "$PAIR" || exit 1
fbdctl add $@ >/dev/null fbdctl add $@ >/dev/null
#fbdctl list #fbdctl list
RES="`$RWBLOCKS /dev/fbd`" RES="`$RWBLOCKS /dev/fbd`"
service down fbd minix-service down fbd
echo -n "$RES: " echo -n "$RES: "
if echo "$RES" | egrep "^$EXP\$" >/dev/null 2>&1; then if echo "$RES" | egrep "^$EXP\$" >/dev/null 2>&1; then
if [ "$OPT" = "-last" -a "$RES" != "$LAST" ]; then if [ "$OPT" = "-last" -a "$RES" != "$LAST" ]; then
@ -115,11 +115,11 @@ write_test() {
WS=$3 WS=$3
shift 3 shift 3
$RWBLOCKS $DEV UUUUUUUUUUUUUUUU $RWBLOCKS $DEV UUUUUUUUUUUUUUUU
service up /service/fbd -dev /dev/fbd -args "$PAIR" || exit 1 minix-service up /service/fbd -dev /dev/fbd -args "$PAIR" || exit 1
fbdctl add $@ >/dev/null fbdctl add $@ >/dev/null
#fbdctl list #fbdctl list
$RWBLOCKS /dev/fbd $PAT $WS $RWBLOCKS /dev/fbd $PAT $WS
service down fbd minix-service down fbd
RES="`$RWBLOCKS $DEV`" RES="`$RWBLOCKS $DEV`"
echo -n "$RES: " echo -n "$RES: "
if echo "$RES" | egrep "^$EXP\$" >/dev/null 2>&1; then if echo "$RES" | egrep "^$EXP\$" >/dev/null 2>&1; then

View File

@ -3,7 +3,7 @@
make >/dev/null make >/dev/null
echo -n "Kernel test (sys_padconf): " echo -n "Kernel test (sys_padconf): "
service up `pwd`/padconftest -config system.conf -label padconftest -script /etc/rs.single minix-service up `pwd`/padconftest -config system.conf -label padconftest -script /etc/rs.single
r=$? r=$?
if [ $r -ne 0 ]; then if [ $r -ne 0 ]; then

View File

@ -3,10 +3,10 @@
make >/dev/null make >/dev/null
echo -n "Kernel test (sys_vumap): " echo -n "Kernel test (sys_vumap): "
service up `pwd`/vumaprelay -config system.conf -label vumaprelay -script /etc/rs.single minix-service up `pwd`/vumaprelay -config system.conf -label vumaprelay -script /etc/rs.single
service up `pwd`/vumaptest -config system.conf -script /etc/rs.single 2>/dev/null minix-service up `pwd`/vumaptest -config system.conf -script /etc/rs.single 2>/dev/null
r=$? r=$?
service down vumaprelay minix-service down vumaprelay
if [ $r -ne 0 ]; then if [ $r -ne 0 ]; then
echo "failure" echo "failure"

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
service down grantor minix-service down grantor
service down requestor minix-service down requestor

View File

@ -2,6 +2,6 @@
PWD=`pwd` PWD=`pwd`
service up ${PWD}/grantor -config ${PWD}/system.conf -script ${PWD}/down minix-service up ${PWD}/grantor -config ${PWD}/system.conf -script ${PWD}/down
service up ${PWD}/requestor -config ${PWD}/system.conf -script ${PWD}/down minix-service up ${PWD}/requestor -config ${PWD}/system.conf -script ${PWD}/down

View File

@ -68,14 +68,14 @@ main(int argc, char *argv[])
/* stop residual testvm service if any */ /* stop residual testvm service if any */
snprintf(cmdline, sizeof(cmdline), "%s down testvm >/dev/null 2>&1", snprintf(cmdline, sizeof(cmdline), "%s down testvm >/dev/null 2>&1",
_PATH_SERVICE); _PATH_MINIX_SERVICE);
if(system(cmdline) < 0) { e(9); exit(1); } if(system(cmdline) < 0) { e(9); exit(1); }
/* start the testvm service */ /* start the testvm service */
snprintf(cmdline, sizeof(cmdline), snprintf(cmdline, sizeof(cmdline),
"%s up /%s/../testvm -script /etc/rs.single " "%s up /%s/../testvm -script /etc/rs.single "
"-args /%s/%s -config %s/../testvm.conf", "-args /%s/%s -config %s/../testvm.conf",
_PATH_SERVICE, cwd, cwd, pipefn, cwd); _PATH_MINIX_SERVICE, cwd, cwd, pipefn, cwd);
if(system(cmdline) < 0) { e(10); exit(1); } if(system(cmdline) < 0) { e(10); exit(1); }
/* don't hang forever if the open or read block */ /* don't hang forever if the open or read block */

View File

@ -93,7 +93,7 @@ prepare_service() {
echo $flags | grep -q 'r' || return 0 echo $flags | grep -q 'r' || return 0
echo $flags | grep -q 'R' && return 0 echo $flags | grep -q 'R' && return 0
service clone $label minix-service clone $label
return 1 return 1
} }
@ -102,7 +102,7 @@ cleanup_service() {
label=$1 label=$1
service unclone $label minix-service unclone $label
} }
####################################################################### #######################################################################
@ -120,7 +120,7 @@ pol_restart() {
restarts_pre=$(get_value restarts ${service}) restarts_pre=$(get_value restarts ${service})
endpoint_pre=$(get_value endpoint ${service}) endpoint_pre=$(get_value endpoint ${service})
service fi ${label} minix-service fi ${label}
if ! wait_for_service ${service} ${restarts_pre} if ! wait_for_service ${service} ${restarts_pre}
then then
echo not ok echo not ok
@ -154,7 +154,7 @@ pol_reset() {
restarts_pre=$(get_value restarts ${service}) restarts_pre=$(get_value restarts ${service})
endpoint_pre=$(get_value endpoint ${service}) endpoint_pre=$(get_value endpoint ${service})
service fi ${label} minix-service fi ${label}
if ! wait_for_service ${service} ${restarts_pre} if ! wait_for_service ${service} ${restarts_pre}
then then
echo not ok echo not ok
@ -187,7 +187,7 @@ lu_test_one() {
lu_maxtime=${lu_maxtime:-3HZ} lu_maxtime=${lu_maxtime:-3HZ}
lu_state=${lu_state:-1} lu_state=${lu_state:-1}
service ${lu_opts} update ${prog} -label ${label} -maxtime ${lu_maxtime} -state ${lu_state} minix-service ${lu_opts} update ${prog} -label ${label} -maxtime ${lu_maxtime} -state ${lu_state}
if [ $? -ne $result ] if [ $? -ne $result ]
then then
return 1 return 1
@ -271,18 +271,18 @@ multi_lu_test_one() {
if [ $index -eq $once_index ] if [ $index -eq $once_index ]
then then
service ${lu_opts_once} -q update self \ minix-service ${lu_opts_once} -q update self \
-label ${label} \ -label ${label} \
-maxtime ${lu_maxtime_once} \ -maxtime ${lu_maxtime_once} \
-state ${lu_state_once} || ret=2 -state ${lu_state_once} || ret=2
else else
service ${lu_opts} -q update self \ minix-service ${lu_opts} -q update self \
-label ${label} \ -label ${label} \
-maxtime ${lu_maxtime} \ -maxtime ${lu_maxtime} \
-state ${lu_state} || ret=2 -state ${lu_state} || ret=2
fi fi
done done
service sysctl upd_run minix-service sysctl upd_run
result=$? result=$?
# We may experience transient failures as a result of services # We may experience transient failures as a result of services

View File

@ -12,7 +12,7 @@
bomb() { bomb() {
echo $* echo $*
service down rmibtest 2>/dev/null minix-service down rmibtest 2>/dev/null
exit 1 exit 1
} }
@ -29,7 +29,7 @@ old_nodes=`sysctl -n minix.mib.nodes 2>/dev/null` || bomb "no MIB stats?"
old_objects=`sysctl -n minix.mib.objects 2>/dev/null` || bomb "no MIB stats?" old_objects=`sysctl -n minix.mib.objects 2>/dev/null` || bomb "no MIB stats?"
old_remotes=`sysctl -n minix.mib.remotes 2>/dev/null` || bomb "no MIB stats?" old_remotes=`sysctl -n minix.mib.remotes 2>/dev/null` || bomb "no MIB stats?"
service up `pwd`/rmibtest -label rmibtest -config rmibtest.conf || \ minix-service up `pwd`/rmibtest -label rmibtest -config rmibtest.conf || \
bomb "unable to start test service" bomb "unable to start test service"
cd .. cd ..
@ -55,7 +55,7 @@ sysctl -wq minix.rtest.func=7895375 || bomb "unable to set func value"
# Test the minix.test shadowing subtree using a subset of the regular MIB test # Test the minix.test shadowing subtree using a subset of the regular MIB test
./test87 19 >/dev/null || bomb "test87 reported failure" ./test87 19 >/dev/null || bomb "test87 reported failure"
service down rmibtest minix-service down rmibtest
sleep 1 sleep 1

View File

@ -32,7 +32,7 @@ if vndconfig -l vnd0 >/dev/null 2>&1; then
echo "ok" echo "ok"
exit 0 exit 0
else else
service down vnd0 minix-service down vnd0
fi fi
fi fi
if vndconfig -l vnd1 >/dev/null 2>&1; then if vndconfig -l vnd1 >/dev/null 2>&1; then
@ -41,7 +41,7 @@ if vndconfig -l vnd1 >/dev/null 2>&1; then
echo "ok" echo "ok"
exit 0 exit 0
else else
service down vnd1 minix-service down vnd1
fi fi
fi fi

View File

@ -149,7 +149,7 @@ start_service(char *dev)
snprintf(cmd, sizeof(cmd), snprintf(cmd, sizeof(cmd),
"%s up %s/vnd -label vnd%u -args instance=%u -dev %s", "%s up %s/vnd -label vnd%u -args instance=%u -dev %s",
_PATH_SERVICE, _PATH_DRIVERS, n, n, dev); _PATH_MINIX_SERVICE, _PATH_DRIVERS, n, n, dev);
status = system(cmd); status = system(cmd);
@ -183,8 +183,8 @@ stop_service(int fd, char *dev)
if (verbose) if (verbose)
printf("%s: stopping driver\n", dev); printf("%s: stopping driver\n", dev);
snprintf(cmd, sizeof(cmd), "%s down vnd%u", _PATH_SERVICE, snprintf(cmd, sizeof(cmd), "%s down vnd%u",
vnu.vnu_unit); _PATH_MINIX_SERVICE, vnu.vnu_unit);
system(cmd); system(cmd);
} }