LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   How to find which process started a daemon process in autostart? (http://www.linuxquestions.org/questions/linux-desktop-74/how-to-find-which-process-started-a-daemon-process-in-autostart-909765/)

indiajoe 10-24-2011 04:04 AM

How to find which process started a daemon process in autostart?
 
Hi,
When I installed dropbox it installed a proprietary daemon software. Now each time I login, it automatically starts. (I can see it running by the ps -ef command)
Is there any way to find out how it is starting up at each login? So that i can prevent it from starting automatically.
I used KDE 3.5 (recently forked as Trinity).
This daemon is not in my .bashrc, nor in .kde3/Autostart directory.
But I know it is started by some script in my home directory. Because I installed the software as user.
I can try manual kill of the daemon, but i would like to get a better solution to prevent this proprietary software from auto starting without my permission.
Thanking you,
indiajoe

jhwilliams 10-24-2011 04:58 AM

How about this:

Code:

pid=$(pgrep proprietary-daemon)
# get the PPID and then name for PPID
ps -o comm= -p $(awk '{ print $4 }' /proc/$pid/stat)


indiajoe 10-24-2011 03:48 PM

@jhwilliams: Thankyou verymuch, I didn't know every PID has a stat file in /proc

In this case of dropbox your commands gave me 'init' as output.
So does it mean the dropbox is getting started by init itself when i boot?
I am really surprised how a software installed as user can modify the things init does.

-cheers
indiajoe

jhwilliams 10-24-2011 05:16 PM

I would guess there is an initrc script in /etc/init.rc ?

Are you sure you didn't install with sudo?

indiajoe 10-25-2011 02:19 AM

I monitored 'ps -ef' as another user just after booting up. Then the dropbox daemon was not running. So it is getting started when i login as myself.
The user id of the command which started it was my id only, not root.
From the PID of the process, I can see that it was started after my Firefox. (I never close Firefox while rebooting, so it starts automatically in each login with previous session)
So i suspect the dropbox is also getting started by the kde along with the other software which were running in previous session.
Where does kde save all the list of programs to restart while rebooting?


PS: Since I use Porteus (a modified version of slackware), i don't have sudo command.

Thanking you,
-indiajoe


All times are GMT -5. The time now is 03:37 AM.