This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kill Process Script at Shutdown/Restart

Tags: None
(comma "," separated)
liquid150
Registered Member
Posts
3
Karma
0
OS
I am having trouble getting this to happen. The problem is that when I restart, Cairo Dock never fully closes and I end up with multiple sessions of it running. If I restart again without killing it, I end up with even more instances of it.

I'm trying to get a script to run as I shutdown/restart to kill all instances of cairo dock so that it runs fresh when I reboot. I followed these steps originally, and it appeared to have worked. But now it's not working anymore...I have performed all the steps twice more to no avail, still not working.

Your help would be greatly appreciated...

here are the steps I have taken:
Here's what I did:
1. Navigated to init.d.
Code:
cd /etc/init.d
2. Created new script called killcairo.sh.
Code:
sudo nano killcairo.sh
3. Wrote script to kill all instances of Cairo Dock.
Code:
sudo killall cairo-dock
4. Saved with ctrl-o. Exit with ctrl-x.
5. Make the script executable.
Code:
sudo chmod +x killcairo.sh
6. Add to Shutdown call.
Code:
sudo ln -s /etc/init.d/scriptname /etc/rc0.d/K20killcairo.sh
7. Add to reboot call.
Code:
sudo ln -s /etc/init.d/scriptname /etc/rc6.d/K20killcairo.sh
8. Open System Settings GUI, navigate to "Startup and Shutdown."
9. Click "Add Script." Click the browse button on the right of the new window, navigate to /etc/init.d and select "killcairo.sh." Have "Create as symlink" checked.
10. The script is added to the "Script File" menu. Utilize drop down menu in "Run on" column to change to run on "Shutdown."


Keep in mind that I am a newbie, and I need these types of step by step breakdowns...this is something I have collected from working on this on another forum for about 24 hours.
User avatar
google01103
Manager
Posts
6668
Karma
25
have you looked at fancy tasks dock http://kde-look.org/content/show.php/Fa ... tent=99737 ? probably less problematic than using a Gnome/gtk dock

you could try using kquitapp instead of killall (it should work because cairo uses dbus (?)), also you could try killall --process-group

before logging if you run your script does it kill the dock ? make sure with ksysguard. if you then login is the dock gone?

to me the ini.d is a bit overkill just put the script anywhere in your ~/bin as I'm guessing your the only one using it

also since you own the process why the use of sudo? you as owner can kill you process as you please.


OpenSuse Leap 42.1 x64, Plasma 5.x

liquid150
Registered Member
Posts
3
Karma
0
OS
google01103 wrote:have you looked at fancy tasks dock http://kde-look.org/content/show.php/Fa ... tent=99737 ? probably less problematic than using a Gnome/gtk dock

you could try using kquitapp instead of killall (it should work because cairo uses dbus (?)), also you could try killall --process-group

before logging if you run your script does it kill the dock ? make sure with ksysguard. if you then login is the dock gone?

to me the ini.d is a bit overkill just put the script anywhere in your ~/bin as I'm guessing your the only one using it

also since you own the process why the use of sudo? you as owner can kill you process as you please.

If I manually kill it in Konsole, it kills it and it works fine when I restart. If I don't do it manually, it doesn't work.

I am using init.d because from my first research with google, that's where somebody got a script to run on shutdown/restart, so I went with it and ran. I am open to any suggestions that will work, though, as I am at a loss about what I am doing wrong.

I am also open to other docks. Does the one you linked allow for having one on the side and one on the top, with different things in each?
User avatar
google01103
Manager
Posts
6668
Karma
25
init.d scripts usually for system wide things, just think if it's just for a single user system keeping things simple is good, also if you did a clean install you'd loose those scripts

the fancy panel (right click on desktop -> add panel -> fancy panel) can be placed on top and bottom with different apps, caveat worked on my system but was not stable on my system, ymmv. had much better luck adding the fancy tasks widget (not panel) to regular panels, again, ymmv.

don't know of other kde dock, you can always ask in new thread but don't think there are others

when manually killing it did you use your script? you can write your script so that it tests that cairodock is definitely killed using command: ps aux|grep cairodok, don't write scripts so can't help but Google'ing is good http://www.newegg.com/Product/Product.a ... 6834157863


OpenSuse Leap 42.1 x64, Plasma 5.x

liquid150
Registered Member
Posts
3
Karma
0
OS
Believe me, I have google'd my heart out trying to get this to work. Still haven't had any luck.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]