X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:reply-to:subject:to :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=p7nrdTSnHBu40FgaR3op70ppAZPZiRGCoYDx5v8MvBgvouojdZLdI G55yXbqkuhTOmazj2qIhQq4vfViB6nu7zmu3Qw29lzZrtGauOjzWmz1MsfJYbzRA FozhSDt+OUSKHx4E7+cUaCy+MGiCkFZr3+bwDtMeJfALG9e+V4yQaQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:reply-to:subject:to :mime-version:content-type:content-transfer-encoding; s=default; bh=/2ppuEKNIIUFPUpoWUelFMFGwa4=; b=NvsbeGSrVKiSWgDurHEm0M/fZWS/ u8iPgN57yGu1ZpbqdeM49oDRmy5c6RSGPwSEpWhd8l/wXe6fDMhRBdZATNdoUzPw XNB37zj/bIju3CGyqxafmaP5TRSecXmmCRo9i+YyKDeJNGo80hqpl1HqPtyCZotM oXJbVvffw4pH2UA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: <cygwin.cygwin.com> List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sourceware.org/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,TW_JV autolearn=ham version=3.3.1 Message-ID: <1371716521.698.YahooMailNeo@web162103.mail.bf1.yahoo.com> Date: Thu, 20 Jun 2013 01:22:01 -0700 (PDT) From: Jun Iriola <juniriola AT yahoo DOT com> Reply-To: Jun Iriola <juniriola AT yahoo DOT com> Subject: Different Result using ps -efW (Manual & Cron) To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id r5K8MGT2005952 Hi, I made a simple script that should detect if a certain service is running or not. �Said script will run via cron. When I tested it and executed it manually in the command prompt, it list all Cygwin and Windows processes. But when I put it in cron, the number of services detected were not the same. Account used is the same during manual execution and also on cron. To get the list of services, I use this command /usr/bin/ps -efW. Do you have any idea why such behavior? �Help is very much appreciated. �Thanks. Regards, Jun ==================================================================== Result via manual run � � �UID � � PID � �PPID �TTY � � � �STIME COMMAND �jvi3147 � �5804 � �2192 pty2 � � 16:12:50 /usr/bin/ps cyg_serv � �4304 � �4844 ? � � � �17:53:46 /usr/sbin/sshd cyg_serv � �5964 � �4304 ? � � � �10:16:27 /usr/sbin/sshd �jvi3147 � �2192 � �5964 pty2 � � 10:16:41 /usr/bin/bash �jvi3147 � �5204 � � � 1 ? � � � �11:41:02 /usr/bin/mintty �jvi3147 � �4880 � �5204 pty0 � � 11:41:02 /usr/bin/bash cyg_serv � �4024 � �4304 ? � � � �15:09:27 /usr/sbin/sshd cyg_serv � �1652 � �4304 ? � � � �09:08:35 /usr/sbin/sshd cyg_serv � �2108 � �6088 ? � � � �17:55:14 /usr/sbin/cron cyg_serv � �4844 � � � 1 ? � � � �17:53:46 /usr/bin/cygrunsrv cyg_serv � �6088 � � � 1 ? � � � �17:55:14 /usr/bin/cygrunsrv � � � �0 � � � 4 � � � 0 ? � � � � �Mar 28 System � � � �0 � � 412 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\smss.exe � � � �0 � � 480 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\csrss.exe � � � �0 � � 532 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\wininit.exe � � � �0 � � 608 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\services.exe � � � �0 � � 620 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\lsass.exe � � � �0 � � 628 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\lsm.exe � � � �0 � � 788 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � � 852 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � � 932 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � � 984 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � �1000 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � �1024 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\SLsvc.exe � � � �0 � �1068 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � �1128 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � �1484 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � �1628 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � �1728 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\spoolsv.exe � � � �0 � �2008 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � �2020 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � � 300 � � � 0 ? � � � � �Mar 28 C:\Program Files\Sophos\Remote Management System\ManagementAgentNT.exe � � � �0 � � 424 � � � 0 ? � � � � �Mar 28 C:\Program Files\Sophos\AutoUpdate\ALsvc.exe � � � �0 � � 796 � � � 0 ? � � � � �Mar 28 C:\Program Files\Sophos\Remote Management System\RouterNT.exe � � � �0 � � 680 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\taskeng.exe � � � �0 � �2060 � � � 0 ? � � � � �Mar 28 C:\Program Files\VMware\VMware Tools\vmtoolsd.exe � � � �0 � �2184 � � � 0 ? � � � � �Mar 28 C:\Program Files\VERITAS\VxPBX\bin\pbx_exchange.exe � � � �0 � �2260 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � �2296 � � � 0 ? � � � � �Mar 28 C:\Program Files\VERITAS\NetBackup\bin\vnetd.exe � � � �0 � �2500 � � � 0 ? � � � � �Mar 28 C:\Program Files\VMware\VMware Tools\VMUpgradeHelper.exe � � � �0 � �2532 � � � 0 ? � � � � �Mar 28 C:\Program Files\VERITAS\NetBackup\bin\bpinetd.exe � � � �0 � �2704 � � � 0 ? � � � � �Mar 28 C:\Program Files\VERITAS\NetBackup\bin\bpcd.exe � � � �0 � �2928 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\dllhost.exe � � � �0 � �3028 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\msdtc.exe � � � �0 � �3360 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � �3700 � � � 0 ? � � � � �Mar 28 C:\Windows\System32\svchost.exe � � � �0 � �2224 � � � 0 ? � � � � �Apr �1 C:\Windows\System32\csrss.exe � � � �0 � �1956 � � � 0 ? � � � � �Apr �1 C:\Windows\System32\winlogon.exe � � � �0 � � 944 � � � 0 ? � � � � �Apr �1 C:\Windows\System32\LogonUI.exe � � � �0 � �3292 � � � 0 ? � � � � �Jun �4 C:\Program Files\OCS Inventory Agent\OcsService.exe � � � �0 � �4856 � � � 0 ? � � � � �Jun 12 C:\Program Files\Sophos\Sophos Anti-Virus\SavService.exe � � � �0 � �6120 � � � 0 ? � � � � �Jun 12 C:\Program Files\Sophos\Sophos Anti-Virus\SAVAdminService.exe � � � �0 � �4372 � � � 0 ? � � � � �Jun 12 C:\Program Files\Sophos\Sophos Anti-Virus\sdcservice.exe � � � �0 � �4400 � � � 0 ? � � � � �Jun 12 C:\Program Files\Sophos\Sophos Anti-Virus\Web Intelligence\swi_service.exe � � � �0 � �4424 � � � 0 ? � � � �18:10:12 C:\Windows\System32\csrss.exe � � � �0 � �2440 � � � 0 ? � � � �18:10:12 C:\Windows\System32\winlogon.exe � � � �0 � �1076 � � � 0 ? � � � �18:10:17 C:\Windows\System32\taskeng.exe � � � �0 � �2912 � � � 0 ? � � � �18:10:17 C:\Windows\System32\rdpclip.exe � � � �0 � �2148 � � � 0 ? � � � �18:10:21 C:\Windows\System32\dwm.exe � � � �0 � �5716 � � � 0 ? � � � �18:10:21 C:\Windows\explorer.exe � � � �0 � �2864 � � � 0 ? � � � �18:10:22 C:\Program Files\VMware\VMware Tools\VMwareTray.exe � � � �0 � �5768 � � � 0 ? � � � �18:10:22 C:\Program Files\Sophos\AutoUpdate\ALMon.exe � � � �0 � �4824 � � � 0 ? � � � �18:10:27 C:\Windows\System32\mmc.exe � � � �0 � � 384 � � � 0 ? � � � �18:11:13 C:\Windows\System32\Netplwiz.exe � � � �0 � �5652 � � � 0 ? � � � �11:40:17 C:\Windows\System32\mmc.exe � � � �0 � �4056 � � � 0 ? � � � �11:40:38 C:\Windows\System32\taskmgr.exe � � � �0 � �2144 � � � 0 ? � � � �11:56:25 C:\Windows\System32\LogonUI.exe Result via cron � � � UID � � PID � �PPID �TTY � � � �STIME COMMAND �cyg_serv � �4304 � �4844 ? � � � �17:53:46 /usr/sbin/sshd �cyg_serv � �5964 � �4304 ? � � � �10:16:27 /usr/sbin/sshd � jvi3147 � �2396 � �5532 ? � � � �16:14:02 /usr/bin/ps � jvi3147 � �2192 � �5964 pty2 � � 10:16:41 /usr/bin/bash � jvi3147 � �5204 � � � 1 ? � � � �11:41:02 /usr/bin/mintty � jvi3147 � �4880 � �5204 pty0 � � 11:41:02 /usr/bin/bash �cyg_serv � �4024 � �4304 ? � � � �15:09:27 /usr/sbin/sshd �cyg_serv � �5692 � �2108 ? � � � �16:14:01 /usr/sbin/cron �cyg_serv � �1652 � �4304 ? � � � �09:08:35 /usr/sbin/sshd � jvi3147 � �5532 � �5692 ? � � � �16:14:01 /usr/bin/sh �cyg_serv � �2108 � �6088 ? � � � �17:55:14 /usr/sbin/cron �cyg_serv � �4844 � � � 1 ? � � � �17:53:46 /usr/bin/cygrunsrv �cyg_serv � �6088 � � � 1 ? � � � �17:55:14 /usr/bin/cygrunsrv � � � � 0 � �1076 � � � 0 ? � � � �18:10:17 \Device\HarddiskVolume1\Windows\System32\taskeng.exe � � � � 0 � �2912 � � � 0 ? � � � �18:10:17 \Device\HarddiskVolume1\Windows\System32\rdpclip.exe � � � � 0 � �2148 � � � 0 ? � � � �18:10:21 \Device\HarddiskVolume1\Windows\System32\dwm.exe � � � � 0 � �5716 � � � 0 ? � � � �18:10:21 \Device\HarddiskVolume1\Windows\explorer.exe � � � � 0 � �2864 � � � 0 ? � � � �18:10:22 \Device\HarddiskVolume1\Program Files\VMware\VMware Tools\VMwareTray.exe � � � � 0 � �5768 � � � 0 ? � � � �18:10:22 \Device\HarddiskVolume1\Program Files\Sophos\AutoUpdate\ALMon.exe � � � � 0 � �4056 � � � 0 ? � � � �11:40:38 \Device\HarddiskVolume1\Windows\System32\taskmgr.exe�� -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple