Deleted Added
full compact
rc.subr (286303) rc.subr (288291)
1# $NetBSD: rc.subr,v 1.67 2006/10/07 11:25:15 elad Exp $
1# $NetBSD: rc.subr,v 1.67 2006/10/07 11:25:15 elad Exp $
2# $FreeBSD: head/etc/rc.subr 286303 2015-08-05 03:03:57Z ngie $
2# $FreeBSD: head/etc/rc.subr 288291 2015-09-27 04:03:11Z adrian $
3#
4# Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
5# All rights reserved.
6#
7# This code is derived from software contributed to The NetBSD Foundation
8# by Luke Mewburn.
9#
10# Redistribution and use in source and binary forms, with or without

--- 752 unchanged lines hidden (view full) ---

763# Requires /usr to be mounted.
764#
765# ${name}_groups n Comma separated list of supplementary groups
766# to run the chrooted ${command} with.
767# Requires /usr to be mounted.
768#
769# ${name}_prepend n Command added before ${command}.
770#
3#
4# Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
5# All rights reserved.
6#
7# This code is derived from software contributed to The NetBSD Foundation
8# by Luke Mewburn.
9#
10# Redistribution and use in source and binary forms, with or without

--- 752 unchanged lines hidden (view full) ---

763# Requires /usr to be mounted.
764#
765# ${name}_groups n Comma separated list of supplementary groups
766# to run the chrooted ${command} with.
767# Requires /usr to be mounted.
768#
769# ${name}_prepend n Command added before ${command}.
770#
771# ${name}_login_class n Login class to use, else "daemon".
772#
771# ${rc_arg}_cmd n If set, use this as the method when invoked;
772# Otherwise, use default command (see below)
773#
774# ${rc_arg}_precmd n If set, run just before performing the
775# ${rc_arg}_cmd method in the default
776# operation (i.e, after checking for required
777# bits and process (non)existence).
778# If this completes with a non-zero exit code,

--- 158 unchanged lines hidden (view full) ---

937 rc_flags=$flags
938 else
939 eval rc_flags=\$${name}_flags
940 fi
941 eval _chdir=\$${name}_chdir _chroot=\$${name}_chroot \
942 _nice=\$${name}_nice _user=\$${name}_user \
943 _group=\$${name}_group _groups=\$${name}_groups \
944 _fib=\$${name}_fib _env=\$${name}_env \
773# ${rc_arg}_cmd n If set, use this as the method when invoked;
774# Otherwise, use default command (see below)
775#
776# ${rc_arg}_precmd n If set, run just before performing the
777# ${rc_arg}_cmd method in the default
778# operation (i.e, after checking for required
779# bits and process (non)existence).
780# If this completes with a non-zero exit code,

--- 158 unchanged lines hidden (view full) ---

939 rc_flags=$flags
940 else
941 eval rc_flags=\$${name}_flags
942 fi
943 eval _chdir=\$${name}_chdir _chroot=\$${name}_chroot \
944 _nice=\$${name}_nice _user=\$${name}_user \
945 _group=\$${name}_group _groups=\$${name}_groups \
946 _fib=\$${name}_fib _env=\$${name}_env \
945 _prepend=\$${name}_prepend
947 _prepend=\$${name}_prepend _login_class=\${${name}_login_class:-daemon}
946
947 if [ -n "$_user" ]; then # unset $_user if running as that user
948 if [ "$_user" = "$(eval $IDCMD)" ]; then
949 unset _user
950 fi
951 fi
952
953 [ -z "$autoboot" ] && eval $_pidcmd # determine the pid if necessary

--- 91 unchanged lines hidden (view full) ---

1045 fi
1046 _doit="nice -n $_nice $_doit"
1047 fi
1048 if [ -n "$_prepend" ]; then
1049 _doit="$_prepend $_doit"
1050 fi
1051 fi
1052
948
949 if [ -n "$_user" ]; then # unset $_user if running as that user
950 if [ "$_user" = "$(eval $IDCMD)" ]; then
951 unset _user
952 fi
953 fi
954
955 [ -z "$autoboot" ] && eval $_pidcmd # determine the pid if necessary

--- 91 unchanged lines hidden (view full) ---

1047 fi
1048 _doit="nice -n $_nice $_doit"
1049 fi
1050 if [ -n "$_prepend" ]; then
1051 _doit="$_prepend $_doit"
1052 fi
1053 fi
1054
1055 # Prepend default limits
1056 _doit="limits -C $_login_class $_doit"
1057
1053 # run the full command
1054 #
1055 if ! _run_rc_doit "$_doit"; then
1056 warn "failed to start ${name}"
1057 return 1
1058 fi
1059
1060 # finally, run postcmd

--- 1033 unchanged lines hidden ---
1058 # run the full command
1059 #
1060 if ! _run_rc_doit "$_doit"; then
1061 warn "failed to start ${name}"
1062 return 1
1063 fi
1064
1065 # finally, run postcmd

--- 1033 unchanged lines hidden ---