On Tue, Aug 7, 2012 at 6:42 PM, Osamu Aoki <os...@debian.org> wrote: > On Mon, Aug 06, 2012 at 08:31:03PM +0800, Aron Xu wrote: >> On Mon, Aug 6, 2012 at 8:08 PM, Osamu Aoki <os...@debian.org> wrote: > ... >> > "serial" ? Hmmm... I see what you mean via the script. >> > >> > As I see /etc/X11/Xsession.d, $STARTUP is setup by: >> > >> > 20x11-common_process-args: STARTUP="$1" >> > 50x11-common_determine-startup: STARTUP=x-session-manager >> > 75dbus_dbus-launch: STARTUP="$DBUSLAUNCH --exit-with-session $STARTUP" >> > 90consolekit: STARTUP="$CK_LAUNCH_SESSION $STARTUP" >> > 90gpg-agent: STARTUP="$GPGAGENT --daemon --sh >> > --write-env-file=$PID_FILE $STARTUP" >> > 90x11-common_ssh-agent: STARTUP="$SSHAGENT $SSHAGENTARGS ${TMPDIR:+env >> > TMPDIR=$TMPDIR} $STARTUP" >> > >> > and executed at the end as: >> > >> > 99x11-common_start:exec $STARTUP >> > >> > Now we have $SRARTUP as: >> > >> > /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session >> > x-session-manager >> > >> > You are talking to put im-launch here :-) Very good idea. >> > >> >> Yeah, that's the idea, and the $SRARTUP is correct. > > As I see your code more carefully, you are making another process with > "$@ &" and continuing process.... instead of initializing and starting > x-session-manager with the exec command. > > I initially thought your "$@ &" to be at the end of script with: > > exec $@ > > But this was not the case. > > Since this script is run by dbus, this may be still good and does not > leave any extra process. I also do not understand purpose of infinite > loop at the end without wait. At least waiting every few seconds should > reduce CPU load.... Anyway, I have to admit I have not evaluated all > the options. >
Actually the patch I've given you is a work of 2 hours... There must be things can be improved a lot. I haven't tried to see if using `exec` at the end can work, and this is a good point for me to try out. As for the loop at the end, it doesn't cause any more CPU load because the actual wait command is "read -p > /dev/null", and the while loop is just in case that the `read` call terminates unexpected. > By the way what is the process tree of your system? My system around gdm3 > and ibus are: > $ ps auxf |less > .... > I do not have time to do more testing.... sorry. > I'm away from my working computer for about a week, and now using an old Ubuntu 10.10 installation with im-switch, it's hard to test out the new stuff right now. There should be only a im-launch process left running background with almost no CPU load, and a minimal memory consumption of a dash process (< 2MiB). The `exec` idea may help us save this 2MiB, though. -- Regards, Aron Xu -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org