summaryrefslogtreecommitdiff
path: root/app-misc/sabayon-mce/files/1.1/bin/sabayon-mce-start
blob: ff2f9ee2b9073f8b5657f69e88843c5d2b37ca47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

# setup
myxinitrc="/usr/bin/sabayon-mce-session"
myuser="sabayonmce"
mcepid="/var/sabayonmce/.mcepid"

# make sure samba is started
[[ -f "/etc/init.d/samba" ]] && /etc/init.d/samba start &> /dev/null

# Kill previous instance running since
# /etc/init.d/xdm does not support PIDFILE for
# custom DISPLAYMANAGER
[[ -f "$mcepid" ]] && kill $(cat $mcepid) &> /dev/null

# spawn!
echo $$ > /var/run/sabayon-mce-start.pid
su - ${myuser} -c "source /etc/profile && /usr/bin/sabayon-mce-startx ${myxinitrc} &> /dev/null" &