Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot

Links

XODOX
Impressum

#1: daemon

Posted on 2010-10-07 07:21:47 by Tommy Pham

Hi,

Does anyone have a script running as daemon on Linux/Unix (variants) as part
of your PHP application? If so, what are you using to schedule the script
to run? cron?

Thanks,
Tommy


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message

#2: Re: daemon

Posted on 2010-10-07 07:46:23 by Nathan Nobbe

--0016363b9f960268090492006a8d
Content-Type: text/plain; charset=UTF-8

On Wed, Oct 6, 2010 at 11:21 PM, Tommy Pham <tommyhp2@gmail.com> wrote:

> Hi,
>
> Does anyone have a script running as daemon on Linux/Unix (variants) as
> part
> of your PHP application? If so, what are you using to schedule the script
> to run? cron?
>

cron is one way to do it for scripts you schedule. for real daemon
processes though ive recently deployed a php script on gentoo by leveraging
the init scripts. essentially my program runs a while(true) and uses
pcntl_fork() to create worker children. the parent process listens for
signals which are sent by an init script. theres also a really nice
start-stop-daemon function in the init script library which backgrounds the
process for me and creates a pid lockfile. really slick.

now i have an interface to my script like

/etc/init.d/php-service start

etc. plus it ties right into the runlevel scripts, i just run

rc-update add php-service default

and the script will start when the box hits runlevel 3!

-nathan

--0016363b9f960268090492006a8d--

Report this message

#3: Re: daemon

Posted on 2010-10-07 09:34:10 by Per Jessen

Tommy Pham wrote:

> Hi,
>=20
> Does anyone have a script running as daemon on Linux/Unix (variants)
> as part of your PHP application? =20

Yeah, several.=20

> If so, what are you using to schedule the script to run? cron?

sysVinit and startproc



--=20
Per Jessen, Zürich (12.1ðC)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message

#4: Re: daemon

Posted on 2010-10-07 10:07:51 by Colin Guthrie

'Twas brillig, and Nathan Nobbe at 07/10/10 06:46 did gyre and gimble:
> On Wed, Oct 6, 2010 at 11:21 PM, Tommy Pham <tommyhp2@gmail.com> wrote:
>
>> Hi,
>>
>> Does anyone have a script running as daemon on Linux/Unix (variants) as
>> part
>> of your PHP application? If so, what are you using to schedule the script
>> to run? cron?
>>
>
> cron is one way to do it for scripts you schedule. for real daemon
> processes though ive recently deployed a php script on gentoo by leveraging
> the init scripts. essentially my program runs a while(true) and uses
> pcntl_fork() to create worker children. the parent process listens for
> signals which are sent by an init script. theres also a really nice
> start-stop-daemon function in the init script library which backgrounds the
> process for me and creates a pid lockfile. really slick.
>
> now i have an interface to my script like
>
> /etc/init.d/php-service start
>
> etc. plus it ties right into the runlevel scripts, i just run
>
> rc-update add php-service default
>
> and the script will start when the box hits runlevel 3!

Yeah that's what I do too. Of course systemd will change everything
"initscript" related, but I don't expect it to hit production servers
for a while.

Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mageia Contributor [http://www.mageia.org/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message

#5: Re: Re: daemon

Posted on 2010-10-07 11:39:28 by Per Jessen

Colin Guthrie wrote:

> Yeah that's what I do too. Of course systemd will change everything
> "initscript" related, but I don't expect it to hit production servers=

> for a while.

Could easily be years - the init-sequence is only interesting at
boot-time, and server runs for years (wel, mine certainly do).


/Per

--=20
Per Jessen, Zürich (12.9ðC)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message