Subject: Re: pre-command in rc scripts
To: David Laight <david@l8s.co.uk>
From: =?ISO-8859-1?Q?C=E9sar_Catri=E1n?= C. <ccatrian@eml.cc>
List: netbsd-help
Date: 02/04/2005 00:44:46
David:

That is a very useful advice. But I am affraid I was too vague, trying to g=
et an
answer in particular.

But I will try to be more specific.

I need to pick up some login configuration for my X session; the defaults a=
re
very limited (at least to java). As I am the only user (no ssh or external=
=20
logins in this machine), by using su I can get bigger defaults. As PAM is n=
ot=20
included in the base system yet (except current), I can not get the user co=
ntext
in the appropriate way.

This is a snip of the modified xdm startup script:
<-snip
name=3D"xdm"
rcvar=3D$name
command=3D"/usr/bin/su"
command_args=3D"-c default root -c /usr/X11R6/bin/${name}"
pidfile=3D"/var/run/${name}.pid"
required_files=3D"/usr/X11R6/lib/X11/xdm/xdm-config"
extra_commands=3D"reload"
->snip

This is not the way to do, but it works for me and I would like to use it u=
ntil
some better solution (PAM or something else).

I needed days ago to trace a program that started by a script from the rc.d=
=20
directory. This problem and the xdm problem were very similar to me, so I=20
expected a common solution.

Of course it helps :)

Thanks

C=E9sar

On Thu, 3 Feb 2005 19:03:52 +0000
David Laight <david@l8s.co.uk> wrote:
>
> If you need to get a ktrace for a program that is started by a script
> and/or another program - ie where it is difficult to modify the argument
> list - you can use:
>=20
> # cd directory_where_program_binary_is
> # mv progam_binary program_binary.real
> # cat >program_binary <<EOF
> #! /bin/sh
> exec ktrace -o log_file full_path_to_program.real "$@"
> EOF
> #
>=20
> Dunno if this will help.....
>=20
> 	David