Development

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Running Hook script on Windows

    5 answers - 1724 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    I still am not seeing a file, c:\logfile.txt, created. Its like this
    script isn't even being run.
    I have it named post-commit.bat and, now, post-commit2.bat both located
    in the repositories hooks directory.
    Do I just need to place the files there and they will automatically get
    called? do I need to tell SVN to find them somehow?
    Casey
    Message
    From: Nathan Kidd [mailto:nathan-svn (AT) spicycrypto (DOT) ca]
    Sent: Tuesday, May 09, 2006 4:29 PM
    To: users (AT) subversion (DOT) tigris.org
    Subject: Re: Running Hook script on Windows
    Daniell, Casey B wrote:
    , I am having trouble getting my SVN hook script to run
    automatically under windows, it runs fine by hand (I have the path
    info included in it). When it run manually it creates a file in the C
    drive that I can see, so I know its operating, however, when it should
    run under windows I get nothing, help?
    Its located in the hooks directory of the repository where the checkin
    is occurring, and has been renamed to post-commit.bat as per the
    instructions, what am I missing to get this file called?
    To find out what's going wrong:
    1. rename post-commit.bat post-commit2.bat
    2. create new post-commit.bat with one line like this:
    call %~dp0post-commit2.bat %* c:\logfile.txt 2>&1
    HTH,
    -Nathan
    To unsubscribe, e-mail: users-unsubscribe (AT) subversion (DOT) tigris.org
    For additional commands, e-mail: users-help (AT) subversion (DOT) tigris.org
    To unsubscribe, e-mail: users-unsubscribe (AT) subversion (DOT) tigris.org
    For additional commands, e-mail: users-help (AT) subversion (DOT) tigris.org
  • No.1 | | 867 bytes | |

    Daniell, Casey B wrote:
    I still am not seeing a file, c:\logfile.txt, created. Its like this
    script isn't even being run.

    I have it named post-commit.bat and, now, post-commit2.bat both located
    in the repositories hooks directory.

    Do I just need to place the files there and they will automatically get
    called? do I need to tell SVN to find them somehow?

    If files with the right names exist they will run automatically.

    My only other thought is your server process (svnserve.exe or
    apache.exe) doesn't have enough rights access and/or create files, etc.

    Try making the service run as a different user with more permissions.
    -Nathan

    To unsubscribe, e-mail: users-unsubscribe (AT) subversion (DOT) tigris.org
    For additional commands, e-mail: users-help (AT) subversion (DOT) tigris.org
  • No.2 | | 1565 bytes | |

    Hello Daniel,

    I found the same trouble in a perl script. Windows has some strange or
    stupid (I don't know exactly hall to call it) variables that svn removes
    from the path when the script executes. After I map the following variables,
    my perl script (SVN Notify) run correctly under windows. The variables was:
    - PATH (obvious)
    - S=Windows_NT (perl goes crazy if this variable is not here).
    - SystemRoot=C:\WINDWS (I don't know why, but Net::SMTP don't send the mail
    if this var isn't there).

    Hope this helps.

    []'s

    Eric Lemes

    5/9/06, Nathan Kidd <nathan-svn (AT) spicycrypto (DOT) cawrote:

    Daniell, Casey B wrote:
    I still am not seeing a file, c:\logfile.txt, created. Its like this
    script isn't even being run.

    I have it named post-commit.bat and, now, post-commit2.bat both located
    in the repositories hooks directory.

    Do I just need to place the files there and they will automatically get
    called? do I need to tell SVN to find them somehow?

    If files with the right names exist they will run automatically.

    My only other thought is your server process (svnserve.exe or
    apache.exe) doesn't have enough rights access and/or create files, etc.

    Try making the service run as a different user with more permissions.

    -Nathan
    --

    To unsubscribe, e-mail: users-unsubscribe (AT) subversion (DOT) tigris.org
    For additional commands, e-mail: users-help (AT) subversion (DOT) tigris.org
    --
  • No.3 | | 2985 bytes | |

    in you batch file make sure you are in the correct drive, like this
    would be the very first line of code:

    c:

    (at least that works for us, but we stay on the same drive during the
    whole post-commit)

    i assume this must otherwise have something to do with security, has the
    apache user write access to the specific directory ?

    <T>

    dear all who responded on this original thread.

    (assuming SVN version 1.3.1)
    since you seem to have post-commits running on windows may I ask if you
    could confirm that it is indeed possible to commit to the repository
    without a wait for the post-commit to finish ?

    for example, if you put a

    sleep 120

    in your script, how long will a client's commit actual take.

    we have been running these for a long time, but after upgrading to
    series 1.3.* they simply doesn't work correctly anymore

    </T>

    /allan

    Daniell, Casey B wrote:
    I still am not seeing a file, c:\logfile.txt, created. Its like this
    script isn't even being run.

    I have it named post-commit.bat and, now, post-commit2.bat both located
    in the repositories hooks directory.

    Do I just need to place the files there and they will automatically get
    called? do I need to tell SVN to find them somehow?

    Casey

    Message
    From: Nathan Kidd [mailto:nathan-svn (AT) spicycrypto (DOT) ca]
    Sent: Tuesday, May 09, 2006 4:29 PM
    To: users (AT) subversion (DOT) tigris.org
    Subject: Re: Running Hook script on Windows

    Daniell, Casey B wrote:
    >, I am having trouble getting my SVN hook script to run
    >automatically under windows, it runs fine by hand (I have the path
    >info included in it). When it run manually it creates a file in the C
    >drive that I can see, so I know its operating, however, when it should


    >run under windows I get nothing, help?
    >
    >Its located in the hooks directory of the repository where the checkin


    >is occurring, and has been renamed to post-commit.bat as per the
    >instructions, what am I missing to get this file called?


    To find out what's going wrong:

    1. rename post-commit.bat post-commit2.bat

    2. create new post-commit.bat with one line like this:

    call %~dp0post-commit2.bat %* c:\logfile.txt 2>&1

    HTH,
    -Nathan

    To unsubscribe, e-mail: users-unsubscribe (AT) subversion (DOT) tigris.org
    For additional commands, e-mail: users-help (AT) subversion (DOT) tigris.org

    To unsubscribe, e-mail: users-unsubscribe (AT) subversion (DOT) tigris.org
    For additional commands, e-mail: users-help (AT) subversion (DOT) tigris.org

    To unsubscribe, e-mail: users-unsubscribe (AT) subversion (DOT) tigris.org
    For additional commands, e-mail: users-help (AT) subversion (DOT) tigris.org
  • No.4 | | 1093 bytes | |

    allan juul wrote:
    dear all who responded on this original thread.

    (assuming SVN version 1.3.1)
    since you seem to have post-commits running on windows may I ask if you
    could confirm that it is indeed possible to commit to the repository
    without a wait for the post-commit to finish ?

    for example, if you put a

    sleep 120

    in your script, how long will a client's commit actual take.

    we have been running these for a long time, but after upgrading to
    series 1.3.* they simply doesn't work correctly anymore

    All my pre/post-* scripts finish in < 1 second so I couldn't say.

    I *think* you'd need to launch your process with the 'start' command,
    but I recall another post a few weeks ago talking about a problem with
    even this (including some talk ofredirecting STDUT and STDERR ). Have a
    look in the archives.
    -Nathan

    To unsubscribe, e-mail: users-unsubscribe (AT) subversion (DOT) tigris.org
    For additional commands, e-mail: users-help (AT) subversion (DOT) tigris.org
  • No.5 | | 1765 bytes | |

    Nathan Kidd wrote:
    allan juul wrote:
    >dear all who responded on this original thread.
    >>

    >(assuming SVN version 1.3.1)
    >since you seem to have post-commits running on windows may I ask if
    >you could confirm that it is indeed possible to commit to the
    >repository without a wait for the post-commit to finish ?
    >>

    >for example, if you put a
    >>

    >sleep 120
    >>

    >in your script, how long will a client's commit actual take.
    >>

    >we have been running these for a long time, but after upgrading to
    >series 1.3.* they simply doesn't work correctly anymore


    All my pre/post-* scripts finish in < 1 second so I couldn't say.

    I *think* you'd need to launch your process with the 'start' command,
    but I recall another post a few weeks ago talking about a problem with
    even this (including some talk ofredirecting STDUT and STDERR ). Have a
    look in the archives.
    -Nathan

    thanks. i have looked (and asked before and elsewhere) and have tried
    dozens of combinations of start with various flags - no-one works (for
    me). surely one person must have seen this work on windows.

    could you try just for test purposes to see if you could put a sleep (or
    whatever to make your script take a couple of minutes to finish) and see
    if your client hangs?

    /allan

    To unsubscribe, e-mail: users-unsubscribe (AT) subversion (DOT) tigris.org
    For additional commands, e-mail: users-help (AT) subversion (DOT) tigris.org

Re: Running Hook script on Windows


max 4000 letters.
Your nickname that display:
In order to stop the spam: 0 + 9 =
QUESTION ON "Development"

EMSDN.COM