From: David van Moolenbroek Date: Wed, 22 Feb 2017 15:23:10 +0000 (+0000) Subject: Rename MINIX service(8) to minix-service(8) X-Git-Url: http://zhaoyanbai.com/repos/%22/xml/v3/net/static/gitweb.css?a=commitdiff_plain;h=c58da9fbc35f86051ff0a75e6dd91e937d83cfff;p=minix.git 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 --- diff --git a/distrib/sets/lists/minix-base/mi b/distrib/sets/lists/minix-base/mi index 3c5dc9f93..0f4ba2d25 100644 --- a/distrib/sets/lists/minix-base/mi +++ b/distrib/sets/lists/minix-base/mi @@ -36,7 +36,7 @@ ./bin/mv minix-base ./bin/netconf minix-base ./bin/pax minix-base -./bin/printconfig minix-base +./bin/printconfig minix-base obsolete ./bin/printroot minix-base ./bin/ps minix-base ./bin/pwd minix-base @@ -46,7 +46,7 @@ ./bin/readclock minix-base ./bin/rm minix-base ./bin/rmdir minix-base -./bin/service minix-base +./bin/service minix-base obsolete ./bin/setup minix-base ./bin/sh minix-base ./bin/sleep minix-base @@ -185,6 +185,7 @@ ./sbin/fsck_mfs minix-base ./sbin/halt minix-base ./sbin/init minix-base +./sbin/minix-service minix-base ./sbin/mkfs.mfs minix-base ./sbin/mknod minix-base ./sbin/newfs_ext2fs minix-base @@ -194,6 +195,7 @@ ./sbin/nologin minix-base ./sbin/ping minix-base ./sbin/poweroff minix-base +./sbin/printconfig minix-base ./sbin/reboot minix-base ./sbin/shutdown minix-base ./sbin/sysctl minix-base diff --git a/distrib/sets/lists/minix-debug/mi b/distrib/sets/lists/minix-debug/mi index e15bc27ac..7ca9a7265 100644 --- a/distrib/sets/lists/minix-debug/mi +++ b/distrib/sets/lists/minix-debug/mi @@ -134,7 +134,7 @@ ./usr/libdata/debug/bin/mount.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/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/ps.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/rm.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/sleep.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_mfs.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/newfs_ext2fs.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_v7fs.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/shutdown.debug minix-debug debug ./usr/libdata/debug/sbin/sysctl.debug minix-debug debug diff --git a/distrib/sets/lists/minix-man/mi b/distrib/sets/lists/minix-man/mi index 676d3b4bb..62dcffccd 100644 --- a/distrib/sets/lists/minix-man/mi +++ b/distrib/sets/lists/minix-man/mi @@ -3405,6 +3405,7 @@ ./usr/man/man8/loadramdisk.8 minix-man ./usr/man/man8/makefs.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/mtree.8 minix-man ./usr/man/man8/netconf.8 minix-man @@ -3436,7 +3437,7 @@ ./usr/man/man8/rshd.8 minix-man ./usr/man/man8/screendump.8 minix-man ./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/shutdown.8 minix-man ./usr/man/man8/slip.8 minix-man diff --git a/docs/UPDATING b/docs/UPDATING index 12a5dd7d0..3a53ccdd4 100644 --- a/docs/UPDATING +++ b/docs/UPDATING @@ -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: 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 diff --git a/etc/rc b/etc/rc index f9fcd2140..2f310d3de 100755 --- a/etc/rc +++ b/etc/rc @@ -46,7 +46,7 @@ up() service=$1 shift - service $opt up /service/$service "$@" + minix-service $opt up /service/$service "$@" } edit() @@ -72,7 +72,7 @@ edit() if [ ! -x $binlocation ] then binlocation=/sbin/$service fi - service $opt edit $binlocation -label $service "$@" + minix-service $opt edit $binlocation -label $service "$@" } while getopts 'saf' opt @@ -174,7 +174,7 @@ autoboot|start) rootline=`cat /etc/mtab | grep "on / "` rootfs=fs_`echo "$rootline" | cut -d' ' -f1 | cut -d'/' -f3` roottype=`echo "$rootline" | cut -d' ' -f5` - service -c edit /service/$roottype -label $rootfs + minix-service -c edit /service/$roottype -label $rootfs fi if [ "$sflag" ] @@ -224,11 +224,11 @@ down|stop) if [ -x /service/usbd ] then - service down usbd + minix-service down usbd fi # Tell RS server we're going down. - service shutdown + minix-service shutdown ;; esac diff --git a/etc/rc.capes/BB-BONE-WTHR-01 b/etc/rc.capes/BB-BONE-WTHR-01 index cb60e3e93..a66e48bf2 100644 --- a/etc/rc.capes/BB-BONE-WTHR-01 +++ b/etc/rc.capes/BB-BONE-WTHR-01 @@ -4,17 +4,17 @@ # TSL2550 Ambient Light Sensor 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" # SHT21 Temperature and Humidity Sensor 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" # BMP085 Temperature and Pressure Sensor 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" daemonize tcpd http /usr/share/beaglebone/weather/weatherstation.lua diff --git a/etc/rs.inet b/etc/rs.inet index 448915d7d..128301fe4 100755 --- a/etc/rs.inet +++ b/etc/rs.inet @@ -57,7 +57,7 @@ echo "Arguments: $@" restarts=$(grep restarts /proc/service/$1 |cut -d: -f2) restarts=$(( $restarts + 1 )) -service down "$1" +minix-service down "$1" kill_by_name dhcpd kill_by_name nonamed kill_by_name syslogd @@ -66,10 +66,10 @@ kill_by_name syslogd sleep 3 if [ X`/bin/sysenv lwip` = Xyes ] 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 & 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 fi daemonize nonamed -L diff --git a/etc/usr/rc b/etc/usr/rc index 8603c41d3..ae391f724 100644 --- a/etc/usr/rc +++ b/etc/usr/rc @@ -97,7 +97,7 @@ up() for dir in $SERVICES_DIRS do bin=$dir/$service if [ -x $bin -a -z "$found" ] - then service $opt up $bin "$@" + then minix-service $opt up $bin "$@" echo -n " $service" found=yes fi diff --git a/minix/commands/Makefile b/minix/commands/Makefile index 08f04f17f..35d4e156a 100644 --- a/minix/commands/Makefile +++ b/minix/commands/Makefile @@ -15,13 +15,13 @@ SUBDIR= add_route arp at backup \ intr irdpd isoread \ loadkeys loadramdisk logger look lp \ lpd lspci mail MAKEDEV \ - mount mt netconf \ + minix-service mount mt netconf \ nonamed \ prep printroot \ profile progressbar pr_routes \ ramdisk rarpd rawspeed readclock \ remsync rget rlogin \ - rotate service setup \ + rotate setup \ slip spell sprofalyze sprofdiff srccrc \ svrctl swifi synctree sysenv \ tcpd tcpdp tcpstat telnet \ diff --git a/minix/commands/devmand/main.c b/minix/commands/devmand/main.c index 14810fc64..b22cc5dc3 100644 --- a/minix/commands/devmand/main.c +++ b/minix/commands/devmand/main.c @@ -9,12 +9,10 @@ #include #include #include +#include #include "usb_driver.h" #include "proto.h" -#define SERVICE_BINARY "/bin/service" - - #define DEVMAN_TYPE_NAME "dev_type" #define PATH_LEN 256 #define INVAL_MAJOR -1 @@ -166,8 +164,8 @@ int stop_driver(struct devmand_driver_instance *inst) assert(inst->label); snprintf(cmdl, 1024, "%s down %s %d", - SERVICE_BINARY, inst->label, inst->dev_id); - dbg("executing service: \"%s\"", cmdl); + _PATH_MINIX_SERVICE, inst->label, inst->dev_id); + dbg("executing minix-service: \"%s\"", cmdl); ret = system(cmdl); if (ret != 0) { @@ -201,9 +199,9 @@ int start_driver(struct devmand_driver_instance *inst) assert(inst->label); 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); - dbg("executing service: \"%s\"", cmdl); + dbg("executing minix-service: \"%s\"", 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; - /* start driver (invoke service) */ + /* start driver (invoke minix-service) */ start_driver(drv_inst); /* diff --git a/minix/commands/minix-service/Makefile b/minix/commands/minix-service/Makefile new file mode 100644 index 000000000..2d5851572 --- /dev/null +++ b/minix/commands/minix-service/Makefile @@ -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 diff --git a/minix/commands/service/config.h b/minix/commands/minix-service/config.h similarity index 100% rename from minix/commands/service/config.h rename to minix/commands/minix-service/config.h diff --git a/minix/commands/service/service.8 b/minix/commands/minix-service/minix-service.8 similarity index 84% rename from minix/commands/service/service.8 rename to minix/commands/minix-service/minix-service.8 index 711c02248..b78f94a72 100644 --- a/minix/commands/service/service.8 +++ b/minix/commands/minix-service/minix-service.8 @@ -1,24 +1,24 @@ -.TH SERVICE 8 +.TH MINIX-SERVICE 8 .SH NAME -service \- Manage an operating system service. +minix-service \- Manage an operating system service. .SH SYNOPSIS .PP -\fBservice [-b -c -n -p -r] (up|run|edit|update)\fR \fI\fR +\fBminix-service [-b -c -n -p -r] (up|run|edit|update)\fR \fI\fR [\fB-args\fR \fI\fR] [\fB-dev\fR \fI\fR] [\fB-period\fR \fI\fR] [\fB-script\fR \fI\fR] [\fB-label\fR \fI\fR] [\fB-config\fR \fI\fR] [\fB-state\fR \fI\fR] [\fB-maxtime\fR \fI