0

I'd like to run the Fossil SCM as a service that is called when needed on my Mac Mini Server. How should I go about configuring this?

Stephen
  • 173
  • 1
  • 3
  • 8
  • Yes, I answered my own question, but I thought this might save someone else some work looking for the answers. – Stephen Dec 21 '11 at 15:51
  • could someone add fossil-scm as a tag - if you feel it is appropriate - I don't have the rep. – Stephen Dec 21 '11 at 15:52

1 Answers1

1

Getting the Fossil SCM setup as a server on Mac OS X.

This works on 10.7, but should work back to 10.4 AFAIK.

Pre-requistites:

  • fossil binary somewhere on your system (I used ~/bin/fossil )
  • a fossil repository (or repositories) in a folder (I used ~/fossil-repository )

The steps:

  • put the org.fossil-scm.service.plist file(below) in /Library/LaunchDaemons
  • change references to '/Users/spdegabrielle/'( ~/ ) to your own path
  • open Terminal and type the following:


    sudo launchctl unload /Library/LaunchDaemons/org.fossil-scm.service.plist

  • open your browser to http://localhost:8081/reponame (I used 'projects' the name of my main repository as the default repository)

For more info, check Creating Launch Daemons and Agents.

org.fossil-scm.service.plist

Some explanation as to what is going on:

  • /Library/LaunchDaemons/ is where the .plist files defining 'User Daemons' that are launched as system startup are kept. Some other useful locations: ~/Library/LaunchAgents for each user, and /Library/LaunchAgents for all users.

  • KeepAlive 
Don't restart the service; this way of using fossil works by starting it in response to a request on port 8081.

  • Label
 org.fossil-scm.service 
names the service, so is can be started sudo launchctl load and stopped using sudo launchctl load

  • ProgramArguments 
 
 /Users/spdegabrielle/bin/fossil 
 http 
 --localauth 
 --notfound 
 projects /Users/spdegabrielle/fossil-repository 
 
is the launchd way of saying 
fossil http --localauth --notfound projects /Users/spdegabrielle/fossil-repository

The meanings of the arguments are as follows:

  • fossil http action the request coming from port 8081(in this case), provide the response and quit. (see fossil help http)

  • --localauth auto-sign-in if you are accessing fossil from your server directly with http://127.0.0.1:8081/ or http://localhost:8081/ (see fossil help http)

  • --notfound projects sets the default repository when specifying the repository location as a folder (next) rather than as a specific repository

  • /Users/spdegabrielle/fossil-repository is the respository location (--notfound projects sets the default)

  • RunAtLoad - Don't run it on load - it will be run on demand

  • inetdCompatibility causes launchd will behave like inetd for the launched program

Stephen
  • 173
  • 1
  • 3
  • 8