You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ashwin Patil <as...@robosoftin.com> on 2009/06/06 09:19:45 UTC

post-commit : automation

Dear All, Hi

I am trying to automate some processes through the post-commit file invoke, 
Everything is working fine but I want it to be  run in the background so 
that the SVN client need not wait to complete the process and but should 
complete the commit and exit.



Basically I have a shell script say "/usr/local/bin/archive_process" and 
want it to be invoke through the post-commit when a particular repository 
commits. All it is working fine but the client is exiting with an error 
"time out error" as the "/usr/local/bin/archive_process" takes long time to 
complete process and exit. But however commit completes properly.



I tried by adding the "&" at the end of the "/usr/local/bin/archive_process" 
in the post-commit file but no help.



Please help me, how I can make it success.



 -----------------------------post-commit----------------------------------

#$1-repository path

#$2-revision number

# The bellow shell script archive the data [server copy and checkout copy]

/usr/bin/sudo /usr/local/bin/archive_process $1 $2 &

exit



-----------------------------end of 
file -------------------------------------



  Regards
Ashwin Patil

-----------------------------------------------
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2359945

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: post-commit : automation

Posted by Ashwin Patil <as...@robosoftin.com>.
> /usr/bin/sudo /usr/local/bin/archive_process $REPO $REV >/dev/null 2> 
> dev/null &

Yes- this solved the problem Thanks.

Regards
Ashwin Patil


----- Original Message ----- 
From: "Ryan Schmidt" <su...@ryandesign.com>
To: "Dextrous" <de...@gmail.com>
Cc: "Ashwin Patil" <as...@robosoftin.com>; 
<us...@subversion.tigris.org>
Sent: Sunday, June 07, 2009 4:09 AM
Subject: Re: post-commit : automation


>
> On Jun 6, 2009, at 06:00, Dextrous wrote:
>
>> On Sat, Jun 6, 2009 at 2:49 PM, Ashwin Patil wrote:
>>
>>> I am trying to automate some processes through the post-commit  file 
>>> invoke,
>>> Everything is working fine but I want it to be  run in the  background 
>>> so
>>> that the SVN client need not wait to complete the process and but 
>>> should
>>> complete the commit and exit.
>>>
>>> Basically I have a shell script say "/usr/local/bin/ archive_process" 
>>> and
>>> want it to be invoke through the post-commit when a particular 
>>> repository
>>> commits. All it is working fine but the client is exiting with an  error
>>> "time out error" as the "/usr/local/bin/archive_process" takes  long 
>>> time to
>>> complete process and exit. But however commit completes properly.
>>>
>>> I tried by adding the "&" at the end of the "/usr/local/bin/ 
>>> archive_process"
>>> in the post-commit file but no help.
>>
>> exit 0 should solve the problem
>
> I don't think so; that should already be the default.
>
> I suspect the problem is rather that you need to close the stdout and 
> stderr file handles. Otherwise the client is waiting for output to 
> possibly appear. This has been mentioned on this list before. Try:
>
>
> -----------------------------post- 
> commit----------------------------------
>
> #!/bin/bash
> REPO="$1"
> REV="$2"
> /usr/bin/sudo /usr/local/bin/archive_process $REPO $REV >/dev/null 2>/ 
> dev/null &
>
> -----------------------------end of 
> ile  -------------------------------------
>
>
> Also, be aware that multiple archive_process processes could now be 
> running simultaneously, if multiple commits happen in quick  succession. 
> Make sure archive_process will function correctly in  these situations.
>
>
> 

-----------------------------------------------
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2360174

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: post-commit : automation

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jun 6, 2009, at 06:00, Dextrous wrote:

> On Sat, Jun 6, 2009 at 2:49 PM, Ashwin Patil wrote:
>
>> I am trying to automate some processes through the post-commit  
>> file invoke,
>> Everything is working fine but I want it to be  run in the  
>> background so
>> that the SVN client need not wait to complete the process and but  
>> should
>> complete the commit and exit.
>>
>> Basically I have a shell script say "/usr/local/bin/ 
>> archive_process" and
>> want it to be invoke through the post-commit when a particular  
>> repository
>> commits. All it is working fine but the client is exiting with an  
>> error
>> "time out error" as the "/usr/local/bin/archive_process" takes  
>> long time to
>> complete process and exit. But however commit completes properly.
>>
>> I tried by adding the "&" at the end of the "/usr/local/bin/ 
>> archive_process"
>> in the post-commit file but no help.
>
> exit 0 should solve the problem

I don't think so; that should already be the default.

I suspect the problem is rather that you need to close the stdout and  
stderr file handles. Otherwise the client is waiting for output to  
possibly appear. This has been mentioned on this list before. Try:


-----------------------------post- 
commit----------------------------------

#!/bin/bash
REPO="$1"
REV="$2"
/usr/bin/sudo /usr/local/bin/archive_process $REPO $REV >/dev/null 2>/ 
dev/null &

-----------------------------end of file  
-------------------------------------


Also, be aware that multiple archive_process processes could now be  
running simultaneously, if multiple commits happen in quick  
succession. Make sure archive_process will function correctly in  
these situations.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2360021

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: post-commit : automation

Posted by Dextrous <de...@gmail.com>.
exit 0 should solve the problem

On Sat, Jun 6, 2009 at 2:49 PM, Ashwin Patil <as...@robosoftin.com>wrote:

> Dear All, Hi
>
> I am trying to automate some processes through the post-commit file invoke,
> Everything is working fine but I want it to be  run in the background so
> that the SVN client need not wait to complete the process and but should
> complete the commit and exit.
>
>
>
> Basically I have a shell script say "/usr/local/bin/archive_process" and
> want it to be invoke through the post-commit when a particular repository
> commits. All it is working fine but the client is exiting with an error
> "time out error" as the "/usr/local/bin/archive_process" takes long time to
> complete process and exit. But however commit completes properly.
>
>
>
> I tried by adding the "&" at the end of the
> "/usr/local/bin/archive_process"
> in the post-commit file but no help.
>
>
>
> Please help me, how I can make it success.
>
>
>
>  -----------------------------post-commit----------------------------------
>
> #$1-repository path
>
> #$2-revision number
>
> # The bellow shell script archive the data [server copy and checkout copy]
>
> /usr/bin/sudo /usr/local/bin/archive_process $1 $2 &
>
> exit
>
>
>
> -----------------------------end of
> file -------------------------------------
>
>
>
>  Regards
> Ashwin Patil
>
> -----------------------------------------------
> Robosoft Technologies - Come home to Technology
>
> Disclaimer: This email may contain confidential material. If you were not
> an intended recipient, please notify the sender and delete all copies.
> Emails to and from our network may be logged and monitored. This email and
> its attachments are scanned for virus by our scanners and are believed to be
> safe. However, no warranty is given that this email is free of malicious
> content or virus.
>
> ------------------------------------------------------
>
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2359945
>
> To unsubscribe from this discussion, e-mail: [
> users-unsubscribe@subversion.tigris.org].
>



-- 
Cheers,
Vishwajeet
http://www.singhvishwajeet.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2359957

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].