Hallo,

ich möchte smarthome unter Ubuntu automatisch und habe dafür ein Skript /etc/init.d/smarthome angelegt.
Dabei wird smarthome.py unter root gestartet. Ich möchte aber dass smarthome unter dem User "smarthome" läuft. Hat das schon jemand hinbekommen?

Hier mein Init-Skript:
Code:
#! /bin/sh

#/etc/init.d/smarthome
# Starts and stops smarthome 
### BEGIN INIT INFO
# Provides:          Was macht das Skript?
# Required-Start:    
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Kurze Beschreibung
# Description:       Längere Bechreibung
### END INIT INFO

NAME=smarthome
 
PID=/usr/local/smarthome/var/run/$NAME.pid
DAEMON=/usr/local/smarthome/bin/$NAME.py
 
# Start smarthome 
start(){
 echo "Starting Smarthome.py"
 $DAEMON --start
 echo ""
}
 
# Stop smarthome 
stop(){
 echo "Stopping Smarthome.py"
 $DAEMON --stop
}
 
 
case "$1" in
start)
 start
;;
stop)
 stop
;;
restart)
 stop
 sleep 5
 start
;;
*) # Display a usage option.
 echo "Usage: /etc/init.d/smarthome {start|stop|restart}"
 exit 1
;;
esac
exit 0
Grüße,
Michael