You are not logged in.

#1 2010-01-08 13:01:13

JuseBox
Member
Registered: 2009-11-27
Posts: 260

[Solved] Multiple Openbox Processes

CLICK HERE FOR MY IMAGE

I thought I would ask this since i have been looking around the webs for a few days with no luck and looked through the forums.  There is a few instances of openbox running but with no CPU or Mem affected just kinda sitting there.  There are 4 there now, if I kill three of them nothing happens but if I kill the forth of course kills openbox and i have to restart openbox.  I guess my question is should that be happening and if so why is it?  I have hide userland threads which i know can sometimes confuse people but that isn't the case here. If anyone knows that would be great. Thanks!

Last edited by JuseBox (2010-01-08 17:44:31)


Linux ArchLinux 3.2.8-1-ARCH
#1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012 x86_64 AMD FX(tm)-8120 Eight-Core Processor AuthenticAMD GNU/Linux
8192MB DDR3 1300MHz | Asus m5a97 | GeForce GTX 550 Ti | 120 GB SSD

Offline

#2 2010-01-08 16:29:34

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [Solved] Multiple Openbox Processes

Your image doesn't show the PPID column (parent process)
With that info added, here is what I have on my machine :

UID        PID  PPID  C STIME TTY          TIME CMD
berbae    4866  4815  0 11:47 ?        00:00:00 /usr/bin/openbox
berbae    4880     1  0 11:47 ?        00:00:00 dbus-launch --sh-syntax --exit-with-session
berbae    4881     1  0 11:47 ?        00:00:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
berbae    4887  4866  0 11:47 ?        00:00:00 xscreensaver -no-splash
berbae    4888  4866  0 11:47 ?        00:00:22 conky
berbae    4889  4866  0 11:47 ?        00:00:00 xclock -geometry 120x120-85+35 -padding 12 -norender -bg #061510 -fg green -hd #FA54A7 -hl #FA
berbae    4890  4866  0 11:47 ?        00:00:00 /bin/sh /usr/bin/openbox-session
berbae    4900  4890  0 11:47 ?        00:00:00 tint2
berbae    4891  4866  0 11:47 ?        00:00:00 /bin/sh /usr/bin/openbox-session
berbae    4901  4891  0 11:47 ?        00:00:10 parcellite
berbae    4892  4866  0 11:47 ?        00:00:00 /bin/sh /usr/bin/openbox-session
berbae    4905  4892  0 11:47 ?        00:00:07 ipager
berbae    4893  4866  0 11:47 ?        00:00:00 /bin/sh /usr/bin/openbox-session
berbae    4904 4893  0 11:47 ?        00:00:00 wbar -config /home/berbae/.wbar -zoomf 1.5 -pos top-right -vbar -nanim 6 -nofont

My ~/.config/openbox/autostart.sh script :

# D-bus
if which dbus-launch >/dev/null 2>&1 && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
   eval `dbus-launch --sh-syntax --exit-with-session`
fi

# Programs to launch at startup
numlockx on &
PID=$(pidof -o %PPID /usr/bin/halevt)
[ -z "$PID" ] && /usr/bin/halevt
sh ~/.fehbg &
xscreensaver -no-splash &
conky &
xclock -geometry 120x120-85+35 -padding 12 -norender -bg "#061510" -fg green -hd "#FA54A7" -hl "#FA54A7" &

# Programs that will run after Openbox has started
(sleep 1 && tint2) &
(sleep 2 && parcellite) &
(sleep 3 && ipager) &
(sleep 3 && wbar -config ~/.wbar -zoomf 1.5 -pos top-right -vbar -nanim 6 -nofont) &

Each command in the " Programs that will run after Openbox has started" section has its own shell and openbox-session process.

I think I've read a way to prevent the 'sh openbox-session' processes from staying there after the command is launched, but I don't remember precisely what it is now, I think using the exec command.
If I can find that again I will edit that post.

Offline

#3 2010-01-08 16:45:08

JuseBox
Member
Registered: 2009-11-27
Posts: 260

Re: [Solved] Multiple Openbox Processes

Ok thanks for your help. I know its a more technical question I am just glad someone was able to point it out.  I don't restart my pc all that often so killing those extra threads doesn't really bother me.  If I weren't so anal about how my system is I would just leave them there! lol  Thanks again! 

-That script would be very helpful.


Linux ArchLinux 3.2.8-1-ARCH
#1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012 x86_64 AMD FX(tm)-8120 Eight-Core Processor AuthenticAMD GNU/Linux
8192MB DDR3 1300MHz | Asus m5a97 | GeForce GTX 550 Ti | 120 GB SSD

Offline

#4 2010-01-08 16:49:31

JuseBox
Member
Registered: 2009-11-27
Posts: 260

Re: [Solved] Multiple Openbox Processes

I think I've read a way to prevent the 'sh openbox-session' processes from staying there after the command is launched, but I don't remember precisely what it is now, I think using the exec command.
If I can find that again I will edit that post.

Does this look correct?

#!/bin/bash

OPENBOX=$(which openbox)
CHILD=$$

while [ 1 ]
do
  if [ "$CHILD" ]
  then
    if  [ -d "/proc/$CHILD" ]
    then
    PARENT=$(awk '/^PPid:/ {print $2}'  /proc/$CHILD/status)
    if [ "$PARENT" ]
    then
      EXE=$(readlink /proc/$PARENT/exe | \
        awk '{gsub(/ +\(deleted\)$/,""); print}' )
      if [ "$EXE" == "$OPENBOX" ]
      then
        kill $PARENT
        exit 0
      fi
      CHILD=$PARENT
    else
      echo "No parent!"
      exit 3
    fi
    else
      echo "No proc/$CHILD"
      exit 2
    fi
  else
   echo "No child!"
   exit 1
  fi
done

Linux ArchLinux 3.2.8-1-ARCH
#1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012 x86_64 AMD FX(tm)-8120 Eight-Core Processor AuthenticAMD GNU/Linux
8192MB DDR3 1300MHz | Asus m5a97 | GeForce GTX 550 Ti | 120 GB SSD

Offline

#5 2010-01-08 17:33:11

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [Solved] Multiple Openbox Processes

Before seeing your post, these staying shell processes don't bother me, but following my answer I changed the end of the autostart.sh to :

# Programs that will run after Openbox has started
(sleep 1 && exec tint2) &
(sleep 2 && exec parcellite) &
(sleep 3 && exec ipager) &
(sleep 3 && exec wbar -config ~/.wbar -zoomf 1.5 -pos top-right -vbar -nanim 6 -nofont) &

and now I get :

berbae    5556  5534  0 18:21 ?        00:00:00 /usr/bin/openbox
berbae    5570     1  0 18:21 ?        00:00:00 dbus-launch --sh-syntax --exit-with-session
berbae    5571     1  0 18:21 ?        00:00:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
berbae    5577  5556  0 18:21 ?        00:00:00 xscreensaver -no-splash
berbae    5578  5556  0 18:21 ?        00:00:00 conky
berbae    5579  5556  0 18:21 ?        00:00:00 xclock -geometry 120x120-85+35 -padding 12 -norender -bg #061510 -fg green -hd #FA54A7 -hl #FA
berbae    5580  5556  0 18:21 ?        00:00:00 tint2
berbae    5581  5556  0 18:21 ?        00:00:00 parcellite
berbae    5582  5556  0 18:21 ?        00:00:00 ipager
berbae    5583  5556  0 18:21 ?        00:00:00 wbar -config /home/berbae/.wbar -zoomf 1.5 -pos top-right -vbar -nanim 6 -nofont

So with that change there is no need for the script you presented.

      if [ "$EXE" == "$OPENBOX" ]
      then
        kill $PARENT
        exit 0
      fi

No be cool don't kill parent please ! big_smile

Last edited by berbae (2010-01-08 17:34:40)

Offline

#6 2010-01-08 17:35:20

JuseBox
Member
Registered: 2009-11-27
Posts: 260

Re: [Solved] Multiple Openbox Processes

berbae wrote:

Before seeing your post, these staying shell processes don't bother me, but following my answer I changed the end of the autostart.sh to :

# Programs that will run after Openbox has started
(sleep 1 && exec tint2) &
(sleep 2 && exec parcellite) &
(sleep 3 && exec ipager) &
(sleep 3 && exec wbar -config ~/.wbar -zoomf 1.5 -pos top-right -vbar -nanim 6 -nofont) &

and now I get :

berbae    5556  5534  0 18:21 ?        00:00:00 /usr/bin/openbox
berbae    5570     1  0 18:21 ?        00:00:00 dbus-launch --sh-syntax --exit-with-session
berbae    5571     1  0 18:21 ?        00:00:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
berbae    5577  5556  0 18:21 ?        00:00:00 xscreensaver -no-splash
berbae    5578  5556  0 18:21 ?        00:00:00 conky
berbae    5579  5556  0 18:21 ?        00:00:00 xclock -geometry 120x120-85+35 -padding 12 -norender -bg #061510 -fg green -hd #FA54A7 -hl #FA
berbae    5580  5556  0 18:21 ?        00:00:00 tint2
berbae    5581  5556  0 18:21 ?        00:00:00 parcellite
berbae    5582  5556  0 18:21 ?        00:00:00 ipager
berbae    5583  5556  0 18:21 ?        00:00:00 wbar -config /home/berbae/.wbar -zoomf 1.5 -pos top-right -vbar -nanim 6 -nofont

So with that change there is no need for the script you presented.

      if [ "$EXE" == "$OPENBOX" ]
      then
        kill $PARENT
        exit 0
      fi

No be cool don't kill parent please ! big_smile

Thanks for the input!


Linux ArchLinux 3.2.8-1-ARCH
#1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012 x86_64 AMD FX(tm)-8120 Eight-Core Processor AuthenticAMD GNU/Linux
8192MB DDR3 1300MHz | Asus m5a97 | GeForce GTX 550 Ti | 120 GB SSD

Offline

Board footer

Powered by FluxBB