Review request: sabayon
John Dennis
jdennis at redhat.com
Mon Mar 21 15:53:32 UTC 2005
On Sun, 2005-03-20 at 00:11 -1000, Warren Togami wrote:
> Mark McLoughlin wrote:
> > On Sat, 2005-03-19 at 00:27 -1000, Warren Togami wrote:
> >
> >>Mark McLoughlin wrote:
> >
> >
> >>%pre
> >>/usr/sbin/groupadd -r %{name} &>/dev/null || :
> >>/usr/sbin/useradd -r -s /sbin/nologin -c "Sabayon user" -g %{name}
> >>%{name} &>/dev/null || :
> >>/usr/sbin/usermod -d "" %{name} &>/dev/null || :
> >>
> >>Have you tested the effect of this during an upgrade from one package to
> >>another?
> >
> >
> > Yep, seems fine.
>
> Seems fine because it redirected the error messages to /dev/null?
>
> http://fedoraproject.org/wiki/PackagingGuidelines
> "Running scriptlets only in certain situations"
> According to this table %pre is being run during package upgrade. You
> probably want to test the parameter to only create accounts in the
> install case.
>
> Although I didn't actually test your package, so I may be wrong for some
> unknown reason. Please educate me if I am wrong.
Several of the packages that I'm familar with that need to create a
system account unconditionally invoke useradd. When I added a test for
the presence of the user in a spec file before invoking useradd Nalin
commented this was uncessessary. The only thing I think you may need to
be careful about is to make the the %pre scriptlet exits with 0, it may
be the case useradd exits with a non-zero status if the user already
exists.
--
John Dennis <jdennis at redhat.com>
More information about the fedora-extras-list
mailing list