Mailing List Archive

Trac as a windows service
Hi all,
Does anyone have experience with running trac as a windows service?

I've tried various methods including the python script provided in trac
hacks, .bat files etc.

The issue I hit is that it starts trac ok, but stopping it stops the
service but tracd keeps running in the background thus trac doesn't stop.

Any thoughts on how to fix this or working examples would be appreciated.
Just need a way to ensure trac starts and stops as a service rather than
just using cmd. Stand alone server btw.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com.
Re: Trac as a windows service [ In reply to ]
I used to use Apache under Windows, but it's difficult to get everything
needed for my configurations, and I've since turned to either WSL or full
Linux (via Hyper-V). Using WSL probably isn't a good idea, but I used
Windows Task Scheduler to start it at bootup.

I know of people who have used non-sucking service manager to turn general
applications into services, but I don't have specific experience with it
myself. I think there are other apps that do something similar.

Good Luck



On Monday, April 22, 2024 at 11:53:45?AM UTC-5 Jamie wrote:

> Hi all,
> Does anyone have experience with running trac as a windows service?
>
> I've tried various methods including the python script provided in trac
> hacks, .bat files etc.
>
> The issue I hit is that it starts trac ok, but stopping it stops the
> service but tracd keeps running in the background thus trac doesn't stop.
>
> Any thoughts on how to fix this or working examples would be appreciated.
> Just need a way to ensure trac starts and stops as a service rather than
> just using cmd. Stand alone server btw.
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/eb0b717b-1e61-420c-bdb9-e78cb64ac828n%40googlegroups.com.
Re: Trac as a windows service [ In reply to ]
Hello,

You might want to check out these two articles.


-
https://thepythoncorner.com/posts/2018-08-01-how-to-create-a-windows-service-in-python/
- https://trac.edgewall.org/wiki/Gunicorn


The first article explains how to register your Python program with Windows
Services.

The second document describes how to get Trac to work with Gunicorn.

Instead of using the trac -d command to run trac, I think it should work
with Gunicorn.

Give it a try and good luck.
------------------------------------------------------------------------
------------------------------------
There is a future society, but my future is not what others do.
Dept. of Information Science, Graduate School, Korea National Open
University


2024? 4? 23? (?) ?? 1:53, Jamie <jamietrac473@gmail.com>?? ??:

> Hi all,
> Does anyone have experience with running trac as a windows service?
>
> I've tried various methods including the python script provided in trac
> hacks, .bat files etc.
>
> The issue I hit is that it starts trac ok, but stopping it stops the
> service but tracd keeps running in the background thus trac doesn't stop.
>
> Any thoughts on how to fix this or working examples would be appreciated.
> Just need a way to ensure trac starts and stops as a service rather than
> just using cmd. Stand alone server btw.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Trac Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to trac-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com
> <https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAPCiUfz-HoA%3DJ5gb1mYDii_JUd4QD2oYSEozya90CW%3DRRXnrgg%40mail.gmail.com.
Re: Trac as a windows service [ In reply to ]
Thanks for the responses, much appreciated. However I'm only using trac
standalone server and nothing else. Dan unfortunately NSSM is no longer
maintained.

Jiho thanks for the python link - I do have the script and it works to
start the service the issue I have is with getting the service to stop
while using tracd.

On Monday, April 22, 2024 at 8:23:32?PM UTC+1 jiho lee wrote:

> Hello,
>
> You might want to check out these two articles.
>
>
> -
> https://thepythoncorner.com/posts/2018-08-01-how-to-create-a-windows-service-in-python/
> - https://trac.edgewall.org/wiki/Gunicorn
>
>
> The first article explains how to register your Python program with
> Windows Services.
>
> The second document describes how to get Trac to work with Gunicorn.
>
> Instead of using the trac -d command to run trac, I think it should work
> with Gunicorn.
>
> Give it a try and good luck.
> ------------------------------------------------------------------------
> ------------------------------------
> There is a future society, but my future is not what others do.
> Dept. of Information Science, Graduate School, Korea National Open
> University
>
>
> 2024? 4? 23? (?) ?? 1:53, Jamie <jamiet...@gmail.com>?? ??:
>
>> Hi all,
>> Does anyone have experience with running trac as a windows service?
>>
>> I've tried various methods including the python script provided in trac
>> hacks, .bat files etc.
>>
>> The issue I hit is that it starts trac ok, but stopping it stops the
>> service but tracd keeps running in the background thus trac doesn't stop.
>>
>> Any thoughts on how to fix this or working examples would be appreciated.
>> Just need a way to ensure trac starts and stops as a service rather than
>> just using cmd. Stand alone server btw.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Trac Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to trac-users+...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com
>> <https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/6698e6ed-44fd-4458-873a-281d64d54ca5n%40googlegroups.com.
Re: Trac as a windows service [ In reply to ]
We recommend creating code to run using the waitress API instead of tracd.
------------------------------------------------------------------------
------------------------------------
There is a future society, but my future is not what others do.
Dept. of Information Science, Graduate School, Korea National Open
University


2024? 4? 23? (?) ?? 4:57, Jamie <jamietrac473@gmail.com>?? ??:

> Thanks for the responses, much appreciated. However I'm only using trac
> standalone server and nothing else. Dan unfortunately NSSM is no longer
> maintained.
>
> Jiho thanks for the python link - I do have the script and it works to
> start the service the issue I have is with getting the service to stop
> while using tracd.
>
> On Monday, April 22, 2024 at 8:23:32?PM UTC+1 jiho lee wrote:
>
>> Hello,
>>
>> You might want to check out these two articles.
>>
>>
>> -
>> https://thepythoncorner.com/posts/2018-08-01-how-to-create-a-windows-service-in-python/
>> - https://trac.edgewall.org/wiki/Gunicorn
>>
>>
>> The first article explains how to register your Python program with
>> Windows Services.
>>
>> The second document describes how to get Trac to work with Gunicorn.
>>
>> Instead of using the trac -d command to run trac, I think it should work
>> with Gunicorn.
>>
>> Give it a try and good luck.
>> ------------------------------------------------------------------------
>> ------------------------------------
>> There is a future society, but my future is not what others do.
>> Dept. of Information Science, Graduate School, Korea National Open
>> University
>>
>>
>> 2024? 4? 23? (?) ?? 1:53, Jamie <jamiet...@gmail.com>?? ??:
>>
>>> Hi all,
>>> Does anyone have experience with running trac as a windows service?
>>>
>>> I've tried various methods including the python script provided in trac
>>> hacks, .bat files etc.
>>>
>>> The issue I hit is that it starts trac ok, but stopping it stops the
>>> service but tracd keeps running in the background thus trac doesn't stop.
>>>
>>> Any thoughts on how to fix this or working examples would be
>>> appreciated. Just need a way to ensure trac starts and stops as a service
>>> rather than just using cmd. Stand alone server btw.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Trac Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to trac-users+...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Trac Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to trac-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/trac-users/6698e6ed-44fd-4458-873a-281d64d54ca5n%40googlegroups.com
> <https://groups.google.com/d/msgid/trac-users/6698e6ed-44fd-4458-873a-281d64d54ca5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAPCiUfzqr4P_zDoNtiiWnagYpGX0WpcZNQ5py-WGh0uu0NidBw%40mail.gmail.com.
Re: Trac as a windows service [ In reply to ]
I do not recommend using tracd.exe as a Windows service, however you could
use IIS with
HttpPlatformHandler to serve Trac.

See
https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows
<https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows?view=vs-2022>

--
Jun Omae <jun66j5@gmail.com> (?? ?)


On Tue, Apr 23, 2024 at 1:53 Jamie <jamietrac473@gmail.com> wrote:

> Hi all,
> Does anyone have experience with running trac as a windows service?
>
> I've tried various methods including the python script provided in trac
> hacks, .bat files etc.
>
> The issue I hit is that it starts trac ok, but stopping it stops the
> service but tracd keeps running in the background thus trac doesn't stop.
>
> Any thoughts on how to fix this or working examples would be appreciated.
> Just need a way to ensure trac starts and stops as a service rather than
> just using cmd. Stand alone server btw.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Trac Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to trac-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com
> <https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMajN6RNhbtKs3Gh1W6iN9eMnf7hGOqWvjr4uzz6CFadFhA%40mail.gmail.com.
Re: Trac as a windows service [ In reply to ]
Ah ok, Thank you. I'll look into that.

On Tuesday, April 23, 2024 at 1:13:48?PM UTC+1 Jun Omae wrote:

> I do not recommend using tracd.exe as a Windows service, however you could
> use IIS with
> HttpPlatformHandler to serve Trac.
>
> See
>
> https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows
>
> <https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows?view=vs-2022>
>
> --
> Jun Omae <jun...@gmail.com> (?? ?)
>
>
> On Tue, Apr 23, 2024 at 1:53 Jamie <jamiet...@gmail.com> wrote:
>
>> Hi all,
>> Does anyone have experience with running trac as a windows service?
>>
>> I've tried various methods including the python script provided in trac
>> hacks, .bat files etc.
>>
>> The issue I hit is that it starts trac ok, but stopping it stops the
>> service but tracd keeps running in the background thus trac doesn't stop.
>>
>> Any thoughts on how to fix this or working examples would be appreciated.
>> Just need a way to ensure trac starts and stops as a service rather than
>> just using cmd. Stand alone server btw.
>>
>> --
>>
> You received this message because you are subscribed to the Google Groups
>> "Trac Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to trac-users+...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com
>> <https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/d7007145-03a3-4813-ae5b-0c616f4e75d1n%40googlegroups.com.
Re: Trac as a windows service [ In reply to ]
If you are not using IIS, you will need to write python code to replace
tracd.

I've included documentation to help you with this in the previous link.

2024? 4? 23? (?) ?? 10:34, Jamie <jamietrac473@gmail.com>?? ??:

> Ah ok, Thank you. I'll look into that.
>
> On Tuesday, April 23, 2024 at 1:13:48?PM UTC+1 Jun Omae wrote:
>
>> I do not recommend using tracd.exe as a Windows service, however you
>> could use IIS with
>> HttpPlatformHandler to serve Trac.
>>
>> See
>>
>> https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows
>>
>> <https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows?view=vs-2022>
>>
>> --
>> Jun Omae <jun...@gmail.com> (?? ?)
>>
>>
>> On Tue, Apr 23, 2024 at 1:53 Jamie <jamiet...@gmail.com> wrote:
>>
>>> Hi all,
>>> Does anyone have experience with running trac as a windows service?
>>>
>>> I've tried various methods including the python script provided in trac
>>> hacks, .bat files etc.
>>>
>>> The issue I hit is that it starts trac ok, but stopping it stops the
>>> service but tracd keeps running in the background thus trac doesn't stop.
>>>
>>> Any thoughts on how to fix this or working examples would be
>>> appreciated. Just need a way to ensure trac starts and stops as a service
>>> rather than just using cmd. Stand alone server btw.
>>>
>>> --
>>>
>> You received this message because you are subscribed to the Google Groups
>>> "Trac Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to trac-users+...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Trac Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to trac-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/trac-users/d7007145-03a3-4813-ae5b-0c616f4e75d1n%40googlegroups.com
> <https://groups.google.com/d/msgid/trac-users/d7007145-03a3-4813-ae5b-0c616f4e75d1n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAPCiUfx6JB%2BqMrMswFy-yVhMG7ruuVKWFxcuA3dYSBtNyjxPtA%40mail.gmail.com.
Re: Trac as a windows service [ In reply to ]
> If you are not using IIS, you will need to write python code to replace tracd.

No need to write any Python code.

Example for web.config to serve http://localhost/trac
====
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*"
modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform
processPath="<your-venv>\Scripts\tracd.exe"
arguments="-s --port=%HTTP_PLATFORM_PORT%
--basic-auth=*,<your-htpasswd-file>,Trac --base-path=/trac
<your-tracenv>"
stdoutLogEnabled="false"
startupTimeLimit="60"
processesPerApplication="4"
>
<environmentVariables>
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
====

On Tue, Apr 23, 2024 at 10:37?PM jiho lee <search5@gmail.com> wrote:
>
> If you are not using IIS, you will need to write python code to replace tracd.
>
> I've included documentation to help you with this in the previous link.
>
> 2024? 4? 23? (?) ?? 10:34, Jamie <jamietrac473@gmail.com>?? ??:
>>
>> Ah ok, Thank you. I'll look into that.
>>
>> On Tuesday, April 23, 2024 at 1:13:48?PM UTC+1 Jun Omae wrote:
>>>
>>> I do not recommend using tracd.exe as a Windows service, however you could use IIS with
>>> HttpPlatformHandler to serve Trac.
>>>
>>> See
>>> https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows
>>>
>>> --
>>> Jun Omae <jun...@gmail.com> (?? ?)
>>>
>>>
>>> On Tue, Apr 23, 2024 at 1:53 Jamie <jamiet...@gmail.com> wrote:
>>>>
>>>> Hi all,
>>>> Does anyone have experience with running trac as a windows service?
>>>>
>>>> I've tried various methods including the python script provided in trac hacks, .bat files etc.
>>>>
>>>> The issue I hit is that it starts trac ok, but stopping it stops the service but tracd keeps running in the background thus trac doesn't stop.
>>>>
>>>> Any thoughts on how to fix this or working examples would be appreciated. Just need a way to ensure trac starts and stops as a service rather than just using cmd. Stand alone server btw.
>>>>
>>>> --
>>>>
>>>> You received this message because you are subscribed to the Google Groups "Trac Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
>>>> To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/8842658a-5f35-44f7-a9c3-992ef60797ebn%40googlegroups.com.
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Trac Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/d7007145-03a3-4813-ae5b-0c616f4e75d1n%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups "Trac Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAPCiUfx6JB%2BqMrMswFy-yVhMG7ruuVKWFxcuA3dYSBtNyjxPtA%40mail.gmail.com.



--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMaiXe_sB7DcEHmMP44wjH3E1NzS1xmuoj265SpoxF3uJig%40mail.gmail.com.