On Mon, Jul 13 2009, Krishnakant wrote:

> hello all,
> I am happy to announce that we are almost ready with the deb packages
> for gnukhata-client as well as server.
> Now we are facing a problem and I thought some one like JTD would
> already know a solution to my problem.
> I have been trying to make a demon for gnukhata's server and want it to
> run as the postgres user.

        Why? If you want there to be a DB that GNU Khata uses, the
 typical thing is to:
  a) Create a package specific user during initial install (i.e., there
     is no such user, and there is no previous version installed on the
     system)
  b) Depend on a database system
  b) Based on the system installed on the target machine, or a use
     choice via debconf, you run a script that
     1) Creates the database
     2) Populates its schema (create table, etc)
     3) create a package specific user in the db
     4) grant all access to the db created to said  user.

>   I would ideally want this to be in the init.d
> for start, stop and restart.  In addition most of the people would want
> this to start at system boot.

        This is normal.

> does some one have a link to a tutorial which would teach this.
> Also I want to know if I want to run this demon as a dedicated user?

        You should.

> For security reasons postgresql has a dedicated user by the name of
> postgres and this is the most recommended way of running the system.

        Not if you want your package to actually get into Debian.

> So while I would want the demon to auto start at system boot, i would
> surely like to know if some one knows to make a demon run as a specific
> user?

        Look at clamav, et al.  Most daemons do not run as root or as
 postgres. 

> I know this might be very simple but this is the first time I am doing
> some thing similar.

        I think you need to program by example :-)

        manoj
-- 
When you die, you lose a very important part of your life. Brooke
Shields
Manoj Srivastava <[email protected]> <http://www.golden-gryphon.com/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C

-- 
http://mm.glug-bom.org/mailman/listinfo/linuxers

Reply via email to