Killing Chrome OS on Chroot Startup #4552
-
When I'm in a chroot, I execute "ps ax -o sess,pgrp,pid,cmd | awk '$4 ~ //chrome$/ { print $3 }' | xargs $nodo kill" to kill chrome os processes to free up my memory usage. However, it gets annoying to do it manually everytime so I'm thinking to add it as a start-up command so it will be done automatically. But, I am worried that the command might execute too early so that it kills chrome processes during chroot startup making it corrupt or something. This may sound stupid but I just want to know if the chroot will start just fine if I auto start the chrome processes command because I don't want to lose my chroot lol Btw I am using Ubuntu Focal Fossa with Xfce. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 11 replies
-
If you wanted to be safe you could create a |
Beta Was this translation helpful? Give feedback.
-
Pretty sure that's a typo. #!/bin/sh
echo "#\!/bin/sh" | \
tee kill-chrome.sh
echo "ps ax -o sess,pgrp,pid,cmd | \\
awk '\$4 ~ /chrome\$/ { print \$3 }' | \\
xargs \$nodo kill \\
exit" | \
tee -a kill-chrome.sh
mv kill-chrome.sh /bin/kill-chrome
cd /bin
sudo chmod a-w kill-chrome
sudo chmod u+w kill-chrome
sudo chmod +s kill-chrome
sudo chown root:root kill-chrome
exit There's probably a better way of doing this, but I'm still kind of new to Linux, so this was something of a learning experience for me. If you want to make this a shell script, don't forget to make it executable with Hope this helps somewhat. |
Beta Was this translation helpful? Give feedback.
-
what happened to init does it start systemd? if this what you wish to kill bull)z@localhost:~$ ps ax -o sess,pgrp,pid,cmd |awk '$4 ~ /init/ {print $3, $4, $5}' 1 /sbin/init |
Beta Was this translation helpful? Give feedback.
-
lmaf no you can see gobal proc via pts mounts in chroot |
Beta Was this translation helpful? Give feedback.
-
what is the insult please ? |
Beta Was this translation helpful? Give feedback.
-
Jesus christ guys calm down, someone here already answered my question a long time ago and I don't even use Crouton or Linux anymore |
Beta Was this translation helpful? Give feedback.
If you wanted to be safe you could create a
.sh
script with the command you use to kill Chrome OS, this could be added to path to make it easy or you could make it run at startup with, let's say, a 10 second wait.