[comp.unix.admin] Error in SunOS4.1.1 /etc/rc

czech@gmdzi.gmd.de (Richard Czech) (02/25/91)

Hi!

We're here running some Sun SPARCstations, SunOS 4.1.1. Every time a
machine boots I get an error message:

 su: illegal option -- c
 	usage: uucico [-xNUM] [-r[0|1]] -sSYSTEM -uUSERID -dSPOOL -iINTERFACE

The problem is in the startup script /etc/rc. Here are the lines in question:

		if [ -d /usr/lib/uucp ]; then
			su uucp -c /usr/lib/uucp/uusched & \
					echo -n ' uucp'

The line with the 'su uucp' is obviously syntactically wrong. The
argument '-c' is between the user name 'uucp' and the command
'/usr/lib/uucp/uusched'.
The manual page of uusched(8c) gives exactly the same (wrong) syntax.

Now my question: For what purpose is the '-c' in that line. How should
the line look if it was correct. Did it run under SunOS 4.0.3 or earlier
versions?

   regards
-----------------------------------------------------------------
        Richard Czech                  e-mail: czech@gmdzi.gmd.DE
          GMD-E.I.S.                           czech@gmdzi.UUCP
        P.O.Box 12 40                  phone:  (+49) 2241 14 2039
D-5205 St. Augustin 1, Germany         fax:    (+49) 2241 14 2342
-----------------------------------------------------------------

dean@fyvie.cs.wisc.edu (Dean Luick) (02/26/91)

In article <4132@gmdzi.gmd.de> czech@gmdzi.gmd.de writes:
>              I get an error message:
>
> su: illegal option -- c
> 	usage: uucico [-xNUM] [-r[0|1]] -sSYSTEM -uUSERID -dSPOOL -iINTERFACE
>
>The problem is in the startup script /etc/rc. Here are the lines in question:
>
>		if [ -d /usr/lib/uucp ]; then
>			su uucp -c /usr/lib/uucp/uusched & \
>					echo -n ' uucp'

What the line is trying to do is run uusched as user uucp.  If you read the
man page for su, you will see that they say that su <login> -c <command> is
legal.  The program su starts the shell program for uucp (from /etc/passwd)
and hands it the "-c <command>" as an argument.  Unfortunately, the "shell"
for uucp is uucico, not the expected "regular" shell, like sh, csh, etc.
Consequently, uucico fails with the above error message.

A fix for this is a fake user, say uucp-adm, that has the uucp uid and gid,
but has a "regular" shell.

dean

barmar@think.com (Barry Margolin) (02/26/91)

In article <4132@gmdzi.gmd.de> czech@gmdzi.gmd.de writes:
>We're here running some Sun SPARCstations, SunOS 4.1.1. Every time a
>machine boots I get an error message:
>
> su: illegal option -- c
> 	usage: uucico [-xNUM] [-r[0|1]] -sSYSTEM -uUSERID -dSPOOL -iINTERFACE
>
>The problem is in the startup script /etc/rc. Here are the lines in question:
>
>		if [ -d /usr/lib/uucp ]; then
>			su uucp -c /usr/lib/uucp/uusched & \
>					echo -n ' uucp'
>
>The line with the 'su uucp' is obviously syntactically wrong. The
>argument '-c' is between the user name 'uucp' and the command
>'/usr/lib/uucp/uusched'.
>The manual page of uusched(8c) gives exactly the same (wrong) syntax.
>
>Now my question: For what purpose is the '-c' in that line. How should
>the line look if it was correct. Did it run under SunOS 4.0.3 or earlier
>versions?

All the arguments to su after the user name are passed to the subprocess,
which is running the user's default shell.  That command line assumes that
uucp is running a normal shell, which allows the option '-c' to specify a
command line to execute.  You apparently have uucp's login shell set to
uucico, which doesn't support this usage.

The passwd file that got installed here when we upgraded to 4.1.1 doesn't
specify uucico as its login shell, it lets the shell default.
--
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar

czech@gmdzi.gmd.de (Richard Czech) (02/27/91)

In article <1991Feb25.201609.26138@daffy.cs.wisc.edu>,
dean@fyvie.cs.wisc.edu (Dean Luick) writes:
|>In article <4132@gmdzi.gmd.de> czech@gmdzi.gmd.de writes:
|>>              I get an error message:
|>>
|>> su: illegal option -- c
|>> 	usage: uucico [-xNUM] [-r[0|1]] -sSYSTEM -uUSERID -dSPOOL -iINTERFACE
|>
|>The program su starts the shell program for uucp (from /etc/passwd)
|>and hands it the "-c <command>" as an argument.  Unfortunately, the "shell"
|>for uucp is uucico, not the expected "regular" shell, like sh, csh, etc.
|>Consequently, uucico fails with the above error message.

Thank you all for the replies and mails. The problem was a wrong entry
in /etc/passwd which defined uucico as the login shell for the uucp
account.                       
   regards
-----------------------------------------------------------------
        Richard Czech                  e-mail: czech@gmdzi.gmd.DE
          GMD-E.I.S.                           czech@gmdzi.UUCP
        P.O.Box 12 40                  phone:  (+49) 2241 14 2039
D-5205 St. Augustin 1, Germany         fax:    (+49) 2241 14 2342
-----------------------------------------------------------------