public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0]
@ 2015-04-09 12:51 cyg Simple
  2015-04-09 20:29 ` Andrew DeFaria
  0 siblings, 1 reply; 11+ messages in thread
From: cyg Simple @ 2015-04-09 12:51 UTC (permalink / raw)
  To: cygwin

From: Jim Reisert AD1C
> 
> Wouldn't it be nice if Cygwin cleaned up the /tmp directory each time the
> computer is re-booted?  I don't know how that would work in real life,
however.
> 

Simply create a scheduled task to execute a windows batch file on system
start that changes directory to the Cygwin /bin directory and executes sh -c
'rm -f /tmp/*'.

--
cyg Simple


--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0]
  2015-04-09 12:51 Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0] cyg Simple
@ 2015-04-09 20:29 ` Andrew DeFaria
  2015-04-09 22:22   ` Mark Hansen
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew DeFaria @ 2015-04-09 20:29 UTC (permalink / raw)
  To: cygwin

On 4/9/2015 5:51 AM, cyg Simple wrote:
> From: Jim Reisert AD1C
>>
>> Wouldn't it be nice if Cygwin cleaned up the /tmp directory each time the
>> computer is re-booted?  I don't know how that would work in real life,
> however.
>>
>
> Simply create a scheduled task to execute a windows batch file on system
> start that changes directory to the Cygwin /bin directory and executes sh -c
> 'rm -f /tmp/*'.
>
> --
> cyg Simple
>
>

Or use cron...
-- 
Andrew DeFaria
http://defaria.com


--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0]
  2015-04-09 20:29 ` Andrew DeFaria
@ 2015-04-09 22:22   ` Mark Hansen
  2015-04-09 23:15     ` Andrew DeFaria
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Hansen @ 2015-04-09 22:22 UTC (permalink / raw)
  To: cygwin

On 4/9/2015 1:28 PM, Andrew DeFaria wrote:
> On 4/9/2015 5:51 AM, cyg Simple wrote:
>>  From: Jim Reisert AD1C
>>>
>>>  Wouldn't it be nice if Cygwin cleaned up the /tmp directory each time the
>>>  computer is re-booted?  I don't know how that would work in real life,
>>  however.
>>>
>>
>>  Simply create a scheduled task to execute a windows batch file on system
>>  start that changes directory to the Cygwin /bin directory and executes sh -c
>>  'rm -f /tmp/*'.
>>
>>  --
>>  cyg Simple
>>
>>
>
> Or use cron...

How can cron help? You don't want to delete these files while some process may be
using them (note: I didn't say while the process has the file open - it may not be
open to be valuable). You really need this clean-up done when the machine boots up
because you know at that point, all the processes that were using those files are
gone.


--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0]
  2015-04-09 22:22   ` Mark Hansen
@ 2015-04-09 23:15     ` Andrew DeFaria
  2015-04-09 23:27       ` Mark Geisert
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew DeFaria @ 2015-04-09 23:15 UTC (permalink / raw)
  To: cygwin

On 4/9/2015 3:22 PM, Mark Hansen wrote:
>>
>> Or use cron...
>
> How can cron help? You don't want to delete these files while some
> process may be
> using them (note: I didn't say while the process has the file open - it
> may not be
> open to be valuable). You really need this clean-up done when the
> machine boots up
> because you know at that point, all the processes that were using those
> files are
> gone.
>
>

Somebody hasn't read man 5 crontab, which states:

These special  time  specification  "nicknames"  are  supported,  which
        replace the 5 initial time and date fields, and are prefixed by 
the '@'
        character:
        @reboot    :    Run once, at startup.
        @yearly    :    Run once a year, ie.  "0 0 1 1 *".
        @annually  :    Run once a year, ie.  "0 0 1 1 *".
        @monthly   :    Run once a month, ie. "0 0 1 * *".
        @weekly    :    Run once a week, ie.  "0 0 * * 0".
        @daily     :    Run once a day, ie.   "0 0 * * *".
        @hourly    :    Run once an hour, ie. "0 * * * *".

-- 
Andrew DeFaria
http://defaria.com


--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0]
  2015-04-09 23:15     ` Andrew DeFaria
@ 2015-04-09 23:27       ` Mark Geisert
  2015-04-10  7:49         ` Kizito Porta Balanyà
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Geisert @ 2015-04-09 23:27 UTC (permalink / raw)
  To: cygwin

Andrew DeFaria writes:
> On 4/9/2015 3:22 PM, Mark Hansen wrote:
> >> Or use cron...
> >
> > How can cron help? You don't want to delete these files while some
> > process may be
> > using them (note: I didn't say while the process has the file open - it
> > may not be
> > open to be valuable). You really need this clean-up done when the
> > machine boots up
> > because you know at that point, all the processes that were using those
> > files are
> > gone.
> 
> Somebody hasn't read man 5 crontab, which states:
> 
> These special  time  specification  "nicknames"  are  supported,  which
>         replace the 5 initial time and date fields, and are prefixed by 
> the ' <at> '
>         character:
>          <at> reboot    :    Run once, at startup.

If you're going to involve cron you probably want to make sure service
dependencies on other Cygwin services are set so they depend on cron.  Just
so their possible use of files in /tmp comes after /tmp has been cleaned.

..mark



--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0]
  2015-04-09 23:27       ` Mark Geisert
@ 2015-04-10  7:49         ` Kizito Porta Balanyà
  2015-04-10  8:20           ` Frank Fesevur
  0 siblings, 1 reply; 11+ messages in thread
From: Kizito Porta Balanyà @ 2015-04-10  7:49 UTC (permalink / raw)
  To: cygwin

Hello,

I'm wondering how cron knows when a machine is rebooted.
What does cron check? Which parameter / file?
Do you know it?

Thanks a lot .



2015-04-10 1:27 GMT+02:00 Mark Geisert <mark@maxrnd.com>:
> Andrew DeFaria writes:
>> On 4/9/2015 3:22 PM, Mark Hansen wrote:
>> >> Or use cron...
>> >
>> > How can cron help? You don't want to delete these files while some
>> > process may be
>> > using them (note: I didn't say while the process has the file open - it
>> > may not be
>> > open to be valuable). You really need this clean-up done when the
>> > machine boots up
>> > because you know at that point, all the processes that were using those
>> > files are
>> > gone.
>>
>> Somebody hasn't read man 5 crontab, which states:
>>
>> These special  time  specification  "nicknames"  are  supported,  which
>>         replace the 5 initial time and date fields, and are prefixed by
>> the ' <at> '
>>         character:
>>          <at> reboot    :    Run once, at startup.
>
> If you're going to involve cron you probably want to make sure service
> dependencies on other Cygwin services are set so they depend on cron.  Just
> so their possible use of files in /tmp comes after /tmp has been cleaned.
>
> ..mark
>
>
>
> --
> 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
>

--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0]
  2015-04-10  7:49         ` Kizito Porta Balanyà
@ 2015-04-10  8:20           ` Frank Fesevur
  2015-04-10 20:39             ` Andrew DeFaria
  0 siblings, 1 reply; 11+ messages in thread
From: Frank Fesevur @ 2015-04-10  8:20 UTC (permalink / raw)
  To: cygwin

2015-04-10 9:49 GMT+02:00 Kizito Porta Balanyà:
> I'm wondering how cron knows when a machine is rebooted.
> What does cron check? Which parameter / file?
> Do you know it?

$ man 5 crontab

See @reboot

Never used it but I assume it will run after cron service is started.

Regards,
Frank

--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0]
  2015-04-10  8:20           ` Frank Fesevur
@ 2015-04-10 20:39             ` Andrew DeFaria
  2015-04-10 21:56               ` Frank Fesevur
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew DeFaria @ 2015-04-10 20:39 UTC (permalink / raw)
  To: cygwin

On 4/10/2015 1:19 AM, Frank Fesevur wrote:
> 2015-04-10 9:49 GMT+02:00 Kizito Porta Balanyà:
>> I'm wondering how cron knows when a machine is rebooted.
>> What does cron check? Which parameter / file?
>> Do you know it?
>
> $ man 5 crontab
>
> See @reboot
>
> Never used it but I assume it will run after cron service is started.
>
> Regards,
> Frank

I haven't used it either, but I saw it there. Makes you wonder what 
would happen if you simply restarted the service or stopped it and then 
started it again.
-- 
Andrew DeFaria
http://defaria.com


--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0]
  2015-04-10 20:39             ` Andrew DeFaria
@ 2015-04-10 21:56               ` Frank Fesevur
  2015-04-11  0:35                 ` LRN
  0 siblings, 1 reply; 11+ messages in thread
From: Frank Fesevur @ 2015-04-10 21:56 UTC (permalink / raw)
  To: cygwin

2015-04-10 22:38 GMT+02:00 Andrew DeFaria:
>> $ man 5 crontab
>>
>> See @reboot
>>
>> Never used it but I assume it will run after cron service is started.
>
> I haven't used it either, but I saw it there. Makes you wonder what would
> happen if you simply restarted the service or stopped it and then started it
> again.

Have cron installed on my laptop so I just tested. And yes, that is
how @reboot works on Cygwin. It runs the job right after the cron
daemon is started, regardless how many times you restart the service.

On Linux it seems to detect that the system really was rebooted.

Regards,
Frank

--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0]
  2015-04-10 21:56               ` Frank Fesevur
@ 2015-04-11  0:35                 ` LRN
  2015-04-13 10:58                   ` Kizito Porta Balanyà
  0 siblings, 1 reply; 11+ messages in thread
From: LRN @ 2015-04-11  0:35 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 959 bytes --]

On 11.04.2015 0:55, Frank Fesevur wrote:
> 2015-04-10 22:38 GMT+02:00 Andrew DeFaria:
>>> $ man 5 crontab
>>>
>>> See @reboot
>>>
>>> Never used it but I assume it will run after cron service is started.
>>
>> I haven't used it either, but I saw it there. Makes you wonder what would
>> happen if you simply restarted the service or stopped it and then started it
>> again.
> 
> Have cron installed on my laptop so I just tested. And yes, that is
> how @reboot works on Cygwin. It runs the job right after the cron
> daemon is started, regardless how many times you restart the service.
> 
> On Linux it seems to detect that the system really was rebooted.
> 

Or, if you have a lot of memory, install ImDisk, create a disk and move temp
directory onto it. It's guaranteed to not to survive reboots. Also, it's
probably faster than having temp directory on a real disk.


-- 
O< ascii ribbon - stop html email! - www.asciiribbon.org

[-- Attachment #1.2: 0x922360B0.asc --]
[-- Type: application/pgp-keys, Size: 1747 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0]
  2015-04-11  0:35                 ` LRN
@ 2015-04-13 10:58                   ` Kizito Porta Balanyà
  0 siblings, 0 replies; 11+ messages in thread
From: Kizito Porta Balanyà @ 2015-04-13 10:58 UTC (permalink / raw)
  To: cygwin

2015-04-11 2:35 GMT+02:00 LRN <lrn1986@gmail.com>:
> On 11.04.2015 0:55, Frank Fesevur wrote:
>> 2015-04-10 22:38 GMT+02:00 Andrew DeFaria:
>>>> $ man 5 crontab
>>>>
>>>> See @reboot
>>>>
>>>> Never used it but I assume it will run after cron service is started.

Yes it is.

After reading again the man, reboot is referred to the start / restart
of the cron service itself, not to the status of the reboot machine.



>>>
>>> I haven't used it either, but I saw it there. Makes you wonder what would
>>> happen if you simply restarted the service or stopped it and then started it
>>> again.
>>
>> Have cron installed on my laptop so I just tested. And yes, that is
>> how @reboot works on Cygwin. It runs the job right after the cron
>> daemon is started, regardless how many times you restart the service.
>>
>> On Linux it seems to detect that the system really was rebooted.
>>
>
> Or, if you have a lot of memory, install ImDisk, create a disk and move temp
> directory onto it. It's guaranteed to not to survive reboots. Also, it's
> probably faster than having temp directory on a real disk.
>
>
> --
> O< ascii ribbon - stop html email! - www.asciiribbon.org

--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-04-13 10:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-09 12:51 Clean up /tmp on system reboot [was: Xorg server always starting up on DISPLAY 3.0] cyg Simple
2015-04-09 20:29 ` Andrew DeFaria
2015-04-09 22:22   ` Mark Hansen
2015-04-09 23:15     ` Andrew DeFaria
2015-04-09 23:27       ` Mark Geisert
2015-04-10  7:49         ` Kizito Porta Balanyà
2015-04-10  8:20           ` Frank Fesevur
2015-04-10 20:39             ` Andrew DeFaria
2015-04-10 21:56               ` Frank Fesevur
2015-04-11  0:35                 ` LRN
2015-04-13 10:58                   ` Kizito Porta Balanyà

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).