Advertisement

Perforce server on Linux problem

Started by June 08, 2007 07:05 AM
1 comment, last by deks 17 years, 5 months ago
Hi. I've set up a perfore server on my kubuntu machine for simple dev at home. I created a 'perforce' user, and everything works fine except that I have to login with this user and manually start the server. It's my first try at linux, so sorry if this is a beginner question: how can I automatically start the perforce server when I boot the linux machine? In other words: how can I automatically start a process on behalf of a particular user? Thanks, JF
1. You have to place a so called "init-script" in /etc/init.d/
e.g. /etc/init.d/performanceserver

this script contains pretty simple commands:
#! /bin/bashstart() {        # do whatever it needs to start the server        return 0}stop() {                # stop the server        return 0}case "$1" in        start)                start                ;;        stop)                stop                ;;        restart|reload)                stop                start                ;;        *)        echo $"Usage: $0 {start|stop|restart}"        exit 1esac        exit 0


2. Then you have to register your init-script to a certain runlevel
( you can view your current runlevel by doing $ runlevel )

Means:
pleace a symlink to your init-script into /etc/rc$(yourrunlevel).d/
e.g.: $ ln -s /etc/init/performanceserver /etc/rc2.d/S99performanceserver


hopefully done!

You can also start, stop and restart your server manually by doing $ sudo /etc/init.d/performanceserver {start,stop,restart}

hope that helps

edit: oh I misread "perforce" ( -> performance ) 8[, sorry

[Edited by - hydroo on June 8, 2007 10:53:59 AM]
Advertisement
Works fine, thanks hydroo! I must say that I'm quite impressed by the quality of kubuntu, makes me wonder why we have to pay for Vista... ;p

This topic is closed to new replies.

Advertisement