Subject: Re: Writing my own script for /etc/rc.d
To: None <netbsd-users@netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-users
Date: 01/03/2004 16:08:21
--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Benjamin Walkenhorst wrote:
> I set the control-script to suid already, I added a line=20
> goldbach_user=3D"krylon"
> to /etc/rc.d/goldbach, but it did not work.

(Unfortunately,) it's only used for $command not for $start_cmd and the lik=
e.
The following should do what you want:

name=3Dgoldbach
rcvar=3D$name
command=3D/usr/tmp/rc.goldbach
command_args=3D$1

load_rc_config $name
run_rc_command "$1"

I guess, you have to UTSL, /etc/rc.subr that is. It contains a little
documentation for itself. Another thing that helps a lot, is adding -x
to the shebang (#!/bin/sh -x) and studying the output.

--=20
Christian

--opJtzjQTFsWo+cga
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQE/9trl0KQix3oyIMcRAgflAJ0agNi7Unbd7LIwKAcqrrEC7K807wCdGYLY
Dy9SN9ix+eXOvTYsGGfXmWU=
=fFK8
-----END PGP SIGNATURE-----

--opJtzjQTFsWo+cga--