|
mac geekeryGet your geek on. |
Script Menu ScriptsSeptember 29, 2004 - 8:25am
I realized recently that there’s a little known feature of Script Menu that I’ve been using without a second thought. As it turns out, Script Menu isn’t just for AppleScript. It can handle any kind of script. Perl, Python, Shell, AppleScript, whatever. Make any script like you normally would (making sure to make it is executable, if necessary!) and drop it in ~/Library/Scripts. About half of mine are shell, half Perl. Here’s a sample.
About JC |
|
||||
Does using the script menu to run non-Applescript scripts leave zombie processes on your system?
I have a script like this in a subdir of my ~/Library/Scripts directory:
When I run it, I end up with a new zombie process:
I haven’t tried every type of “script”, but Bourne shell (sh) and Perl scripts seem to trigger this reliably. At one point, I had a couple of Bourne shell scripts that I was running several times a day, and ended up hitting my per-user process limit. The default limit on my system is 100. You can check your own process limit with ulimit -u (in Bourne derived shells: sh/bash/ksh;zsh) or limit maxproc (in C-shell derived shells: csh/tcsh). Once the number of my normal processes and zombie processes reached 100, I couldn’t launch new applications. Eventually I had to logout to clear up all the zombies.
The bug appears to be in SystemUIServer. A modified version of the same script is below. If you run it, then check the log file and process listing, you can see who the non-reaping parent process is:
(I inserted a line break in that last line to keep the text from being horribly wide)
This is all on 10.3.5 here.
So, does anyone else have this same problem? If so, does anyone know of a good way to see if this bug has already been reported to Apple? If not, should I just report it and let them deal with any duplication?
It’s the
execstatement When I ran just:There were no zombies. When I ran:
... there were. No need for
execanyhow. Anyway, to get rid of the zombies, kill the SystemUIServer (odd name for “that thing that runs menu items” but that’s what it is). It will reload and your items will come back.—
cp
Nice to know that SystemUIServer will be relaunched if it is killed. However, not using
execin the scripts on my system doesn’t prevent the zombies, just changes their “name”.If I just delete the exec from my “
/bin/sh” version, I get this zombie:If I switch to the script to
bash(the exact same script text as your first example in the parent to this post (comment 51)), I get this zombie:So, when using
exec, the process listing displays the zombie as “(say)”, but it doesn’t seem to cause the zombie, at least not on my system. Maybe I just have a mutant system.Yeah, now that I look I have it too. SystemUIServer is broke. Bug report time. :\
—
cp