From kde-devel Fri Jun 07 20:25:51 2002 From: Mark Deneen Date: Fri, 07 Jun 2002 20:25:51 +0000 To: kde-devel Subject: Re: [kde-devel] pid's X-MARC-Message: https://marc.info/?l=kde-devel&m=102348181820730 If I remember correctly, pidof is not always present on all systems. Philip Scott wrote: >You could always use 'pidof '; I don't know if there's a simple way >of doing that from within a program without calling the command line utility >though ;) > >On Friday 07 June 2002 2:29 pm, Mark Deneen wrote: > > >>Sheldon Lee-Wen wrote: >> >> >>>-----BEGIN PGP SIGNED MESSAGE----- >>>Hash: SHA1 >>> >>>Hi again, >>> >>> Anyone know how to get the pid of a process running in the system? I >>>have a daemon that the user can run (called lineakd), and I want to check >>>to see if it is running when I start my gui program (klineakconfig), so >>>that I don't end up running multiple instances of it. (or so I can kill >>>it and start one w/ KProcess). Does anyone know how I can get the pid's >>>of such running processes without do a system call to grep through the >>>output of ps ? >>> >>> >>If you can make your daemon write a file that has the pid in it, that >>seems to be the most portable way. Lots of daemons do this. (apache, etc) >> >>-M >> >> >> >>>>Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to >>>>unsubscribe << >>>> >>>> > > > > >>>Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << >>> >>> > > > > >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<