Matt, Ansgar, and Gergely,

Thanks for the tips.

Can you also help with some advice on the init.d script?

The init.d script for deathstar launches a daemon which listens for
jobs, and one worker per core.

Can I use the same pid file for all of those processes?

-Whit


On Tue, Apr 24, 2012 at 9:46 AM, Matt Zagrabelny <[email protected]> wrote:
> On Tue, Apr 24, 2012 at 8:16 AM, Whit Armstrong
> <[email protected]> wrote:
>> Thanks, Daniel.
>>
>> I would be looking for 60000-64999, assuming my package eventually
>> made it into debian, I suppose it would need to have a 'globally
>> allocated' uid.  The idea is simply not to give users executing an R
>> script on the machine root access.
>>
>> Regarding, reSIProcate, it's cdbs based?  Would the postinst script be
>> the same format if I use dh?  Based on Lucas Nussbaum's tutorial
>> (http://www.debian.org/doc/manuals/packaging-tutorial/packaging-tutorial.en.pdf)
>> I thought that dh would be the way to go for new packages.
>
> I've used the postinst script from the puppet package for creating a
> user. Here is my "version" of it:
>
> ---{start}---
> #!/bin/sh
>
> set -e
>
> if [ "$1" = "configure" ]; then
>
>  # Create the "mailregx" user
>  if ! getent passwd mailregx > /dev/null; then
>    adduser --quiet --system --group --home /var/run/milter-regex  \
>      --no-create-home                                 \
>      --gecos "milter-regex daemon user" \
>      mailregx
>  fi
>
>  # Create the "mailregx" group, if it is missing, and set the
>  # primary group of the "mailregx" user to this group.
>  if ! getent group mailregx > /dev/null; then
>      addgroup --quiet --system mailregx
>      usermod -g mailregx mailregx
>  fi
> fi
>
> #DEBHELPER#
> ---{end}---
>
> The "#DEBHELPER#" chunk is a callback or an include. It allows dh to
> insert code into the script.
>
> After my package is built, the postinst looks like:
>
> ---{start}---
> #!/bin/sh
>
> set -e
>
> if [ "$1" = "configure" ]; then
>
>  # Create the "mailregx" user
>  if ! getent passwd mailregx > /dev/null; then
>    adduser --quiet --system --group --home /var/run/milter-regex  \
>      --no-create-home                                 \
>      --gecos "milter-regex daemon user" \
>      mailregx
>  fi
>
>  # Create the "mailregx" group, if it is missing, and set the
>  # primary group of the "mailregx" user to this group.
>  if ! getent group mailregx > /dev/null; then
>      addgroup --quiet --system mailregx
>      usermod -g mailregx mailregx
>  fi
> fi
>
> # Automatically added by dh_installinit
> if [ -x "/etc/init.d/milter-regex" ]; then
>        update-rc.d milter-regex defaults >/dev/null
>        invoke-rc.d milter-regex start || exit $?
> fi
> # End automatically added section
> ---{end}---
>
> You can see the things that dh can put into the various post/pre
> scripts in /usr/share/debhelper/autoscripts.
>
> HTH,
>
> -mz


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: 
http://lists.debian.org/CAMi=pg5meoix4rasoyvjpu9g0owht31q1np+tg4ey41tib9...@mail.gmail.com

Reply via email to