From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12022 invoked by alias); 20 Jun 2013 08:22:05 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 12004 invoked by uid 89); 20 Jun 2013 08:22:05 -0000 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 Received: from nm12-vm0.bullet.mail.bf1.yahoo.com (HELO nm12-vm0.bullet.mail.bf1.yahoo.com) (98.139.213.140) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 20 Jun 2013 08:22:03 +0000 Received: from [66.196.81.170] by nm12.bullet.mail.bf1.yahoo.com with NNFMP; 20 Jun 2013 08:22:02 -0000 Received: from [98.139.212.243] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 20 Jun 2013 08:22:01 -0000 Received: from [127.0.0.1] by omp1052.mail.bf1.yahoo.com with NNFMP; 20 Jun 2013 08:22:01 -0000 Received: (qmail 1366 invoked by uid 60001); 20 Jun 2013 08:22:01 -0000 Received: from [58.71.41.220] by web162103.mail.bf1.yahoo.com via HTTP; Thu, 20 Jun 2013 01:22:01 PDT Message-ID: <1371716521.698.YahooMailNeo@web162103.mail.bf1.yahoo.com> Date: Thu, 20 Jun 2013 08:33:00 -0000 From: Jun Iriola Reply-To: Jun Iriola Subject: Different Result using ps -efW (Manual & Cron) To: "cygwin@cygwin.com" MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013-06/txt/msg00527.txt.bz2 Hi, I made a simple script that should detect if a certain service is running o= r not. =A0Said script will run via cron. When I tested it and executed it manually in the command prompt, it list al= l Cygwin and Windows processes. But when I put it in cron, the number of se= rvices detected were not the same. Account used is the same during manual e= xecution 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? =A0Help is very much appreciated. = =A0Thanks. Regards, Jun =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Result via manual run =A0 =A0 =A0UID =A0 =A0 PID =A0 =A0PPID =A0TTY =A0 =A0 =A0 =A0STIME COMMAND =A0jvi3147 =A0 =A05804 =A0 =A02192 pty2 =A0 =A0 16:12:50 /usr/bin/ps cyg_serv =A0 =A04304 =A0 =A04844 ? =A0 =A0 =A0 =A017:53:46 /usr/sbin/sshd cyg_serv =A0 =A05964 =A0 =A04304 ? =A0 =A0 =A0 =A010:16:27 /usr/sbin/sshd =A0jvi3147 =A0 =A02192 =A0 =A05964 pty2 =A0 =A0 10:16:41 /usr/bin/bash =A0jvi3147 =A0 =A05204 =A0 =A0 =A0 1 ? =A0 =A0 =A0 =A011:41:02 /usr/bin/min= tty =A0jvi3147 =A0 =A04880 =A0 =A05204 pty0 =A0 =A0 11:41:02 /usr/bin/bash cyg_serv =A0 =A04024 =A0 =A04304 ? =A0 =A0 =A0 =A015:09:27 /usr/sbin/sshd cyg_serv =A0 =A01652 =A0 =A04304 ? =A0 =A0 =A0 =A009:08:35 /usr/sbin/sshd cyg_serv =A0 =A02108 =A0 =A06088 ? =A0 =A0 =A0 =A017:55:14 /usr/sbin/cron cyg_serv =A0 =A04844 =A0 =A0 =A0 1 ? =A0 =A0 =A0 =A017:53:46 /usr/bin/cygru= nsrv cyg_serv =A0 =A06088 =A0 =A0 =A0 1 ? =A0 =A0 =A0 =A017:55:14 /usr/bin/cygru= nsrv =A0 =A0 =A0 =A00 =A0 =A0 =A0 4 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 Sy= stem =A0 =A0 =A0 =A00 =A0 =A0 412 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\smss.exe =A0 =A0 =A0 =A00 =A0 =A0 480 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\csrss.exe =A0 =A0 =A0 =A00 =A0 =A0 532 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\wininit.exe =A0 =A0 =A0 =A00 =A0 =A0 608 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\services.exe =A0 =A0 =A0 =A00 =A0 =A0 620 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\lsass.exe =A0 =A0 =A0 =A00 =A0 =A0 628 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\lsm.exe =A0 =A0 =A0 =A00 =A0 =A0 788 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A0 852 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A0 932 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A0 984 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A01000 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A01024 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\SLsvc.exe =A0 =A0 =A0 =A00 =A0 =A01068 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A01128 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A01484 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A01628 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A01728 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\spoolsv.exe =A0 =A0 =A0 =A00 =A0 =A02008 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A02020 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A0 300 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\P= rogram Files\Sophos\Remote Management System\ManagementAgentNT.exe =A0 =A0 =A0 =A00 =A0 =A0 424 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\P= rogram Files\Sophos\AutoUpdate\ALsvc.exe =A0 =A0 =A0 =A00 =A0 =A0 796 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\P= rogram Files\Sophos\Remote Management System\RouterNT.exe =A0 =A0 =A0 =A00 =A0 =A0 680 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\taskeng.exe =A0 =A0 =A0 =A00 =A0 =A02060 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\P= rogram Files\VMware\VMware Tools\vmtoolsd.exe =A0 =A0 =A0 =A00 =A0 =A02184 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\P= rogram Files\VERITAS\VxPBX\bin\pbx_exchange.exe =A0 =A0 =A0 =A00 =A0 =A02260 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A02296 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\P= rogram Files\VERITAS\NetBackup\bin\vnetd.exe =A0 =A0 =A0 =A00 =A0 =A02500 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\P= rogram Files\VMware\VMware Tools\VMUpgradeHelper.exe =A0 =A0 =A0 =A00 =A0 =A02532 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\P= rogram Files\VERITAS\NetBackup\bin\bpinetd.exe =A0 =A0 =A0 =A00 =A0 =A02704 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\P= rogram Files\VERITAS\NetBackup\bin\bpcd.exe =A0 =A0 =A0 =A00 =A0 =A02928 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\dllhost.exe =A0 =A0 =A0 =A00 =A0 =A03028 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\msdtc.exe =A0 =A0 =A0 =A00 =A0 =A03360 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A03700 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Mar 28 C:\W= indows\System32\svchost.exe =A0 =A0 =A0 =A00 =A0 =A02224 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Apr =A01 C:= \Windows\System32\csrss.exe =A0 =A0 =A0 =A00 =A0 =A01956 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Apr =A01 C:= \Windows\System32\winlogon.exe =A0 =A0 =A0 =A00 =A0 =A0 944 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Apr =A01 C:= \Windows\System32\LogonUI.exe =A0 =A0 =A0 =A00 =A0 =A03292 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Jun =A04 C:= \Program Files\OCS Inventory Agent\OcsService.exe =A0 =A0 =A0 =A00 =A0 =A04856 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Jun 12 C:\P= rogram Files\Sophos\Sophos Anti-Virus\SavService.exe =A0 =A0 =A0 =A00 =A0 =A06120 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Jun 12 C:\P= rogram Files\Sophos\Sophos Anti-Virus\SAVAdminService.exe =A0 =A0 =A0 =A00 =A0 =A04372 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Jun 12 C:\P= rogram Files\Sophos\Sophos Anti-Virus\sdcservice.exe =A0 =A0 =A0 =A00 =A0 =A04400 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A0 =A0Jun 12 C:\P= rogram Files\Sophos\Sophos Anti-Virus\Web Intelligence\swi_service.exe =A0 =A0 =A0 =A00 =A0 =A04424 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:12 C:\Win= dows\System32\csrss.exe =A0 =A0 =A0 =A00 =A0 =A02440 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:12 C:\Win= dows\System32\winlogon.exe =A0 =A0 =A0 =A00 =A0 =A01076 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:17 C:\Win= dows\System32\taskeng.exe =A0 =A0 =A0 =A00 =A0 =A02912 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:17 C:\Win= dows\System32\rdpclip.exe =A0 =A0 =A0 =A00 =A0 =A02148 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:21 C:\Win= dows\System32\dwm.exe =A0 =A0 =A0 =A00 =A0 =A05716 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:21 C:\Win= dows\explorer.exe =A0 =A0 =A0 =A00 =A0 =A02864 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:22 C:\Pro= gram Files\VMware\VMware Tools\VMwareTray.exe =A0 =A0 =A0 =A00 =A0 =A05768 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:22 C:\Pro= gram Files\Sophos\AutoUpdate\ALMon.exe =A0 =A0 =A0 =A00 =A0 =A04824 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:27 C:\Win= dows\System32\mmc.exe =A0 =A0 =A0 =A00 =A0 =A0 384 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:11:13 C:\Win= dows\System32\Netplwiz.exe =A0 =A0 =A0 =A00 =A0 =A05652 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A011:40:17 C:\Win= dows\System32\mmc.exe =A0 =A0 =A0 =A00 =A0 =A04056 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A011:40:38 C:\Win= dows\System32\taskmgr.exe =A0 =A0 =A0 =A00 =A0 =A02144 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A011:56:25 C:\Win= dows\System32\LogonUI.exe Result via cron =A0 =A0 =A0 UID =A0 =A0 PID =A0 =A0PPID =A0TTY =A0 =A0 =A0 =A0STIME COMMAND =A0cyg_serv =A0 =A04304 =A0 =A04844 ? =A0 =A0 =A0 =A017:53:46 /usr/sbin/sshd =A0cyg_serv =A0 =A05964 =A0 =A04304 ? =A0 =A0 =A0 =A010:16:27 /usr/sbin/sshd =A0 jvi3147 =A0 =A02396 =A0 =A05532 ? =A0 =A0 =A0 =A016:14:02 /usr/bin/ps =A0 jvi3147 =A0 =A02192 =A0 =A05964 pty2 =A0 =A0 10:16:41 /usr/bin/bash =A0 jvi3147 =A0 =A05204 =A0 =A0 =A0 1 ? =A0 =A0 =A0 =A011:41:02 /usr/bin/mi= ntty =A0 jvi3147 =A0 =A04880 =A0 =A05204 pty0 =A0 =A0 11:41:02 /usr/bin/bash =A0cyg_serv =A0 =A04024 =A0 =A04304 ? =A0 =A0 =A0 =A015:09:27 /usr/sbin/sshd =A0cyg_serv =A0 =A05692 =A0 =A02108 ? =A0 =A0 =A0 =A016:14:01 /usr/sbin/cron =A0cyg_serv =A0 =A01652 =A0 =A04304 ? =A0 =A0 =A0 =A009:08:35 /usr/sbin/sshd =A0 jvi3147 =A0 =A05532 =A0 =A05692 ? =A0 =A0 =A0 =A016:14:01 /usr/bin/sh =A0cyg_serv =A0 =A02108 =A0 =A06088 ? =A0 =A0 =A0 =A017:55:14 /usr/sbin/cron =A0cyg_serv =A0 =A04844 =A0 =A0 =A0 1 ? =A0 =A0 =A0 =A017:53:46 /usr/bin/cy= grunsrv =A0cyg_serv =A0 =A06088 =A0 =A0 =A0 1 ? =A0 =A0 =A0 =A017:55:14 /usr/bin/cy= grunsrv =A0 =A0 =A0 =A0 0 =A0 =A01076 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:17 \Devi= ce\HarddiskVolume1\Windows\System32\taskeng.exe =A0 =A0 =A0 =A0 0 =A0 =A02912 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:17 \Devi= ce\HarddiskVolume1\Windows\System32\rdpclip.exe =A0 =A0 =A0 =A0 0 =A0 =A02148 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:21 \Devi= ce\HarddiskVolume1\Windows\System32\dwm.exe =A0 =A0 =A0 =A0 0 =A0 =A05716 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:21 \Devi= ce\HarddiskVolume1\Windows\explorer.exe =A0 =A0 =A0 =A0 0 =A0 =A02864 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:22 \Devi= ce\HarddiskVolume1\Program Files\VMware\VMware Tools\VMwareTray.exe =A0 =A0 =A0 =A0 0 =A0 =A05768 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A018:10:22 \Devi= ce\HarddiskVolume1\Program Files\Sophos\AutoUpdate\ALMon.exe =A0 =A0 =A0 =A0 0 =A0 =A04056 =A0 =A0 =A0 0 ? =A0 =A0 =A0 =A011:40:38 \Devi= ce\HarddiskVolume1\Windows\System32\taskmgr.exe=A0=A0 -- 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