diff --git a/docs/freebsd_jails_on_freenas.md b/docs/freebsd_jails_on_freenas.md index 1b31480..a754528 100644 --- a/docs/freebsd_jails_on_freenas.md +++ b/docs/freebsd_jails_on_freenas.md @@ -127,3 +127,54 @@ For python3 virtualenv ```csh virtualenv-3.6 ``` + +## running gitit under the supervision of supervisord +py27-supervisor and hs-gitit are available as pkg install, if you want to +run a gitit wiki. + +gitit doesn't come with an init service. To generate a sample config, +run `gitit --print-default-config > gitit.conf`, and then if you want +you can reference gitit.conf by passing gitit the *-f* flag. + +So for instance, after you install supervisord, add something like the +following to the end of `/usr/local/etc/supervisord.conf`, and create +the directory `/var/log/supervisor/`. + +```conf +[program:gitit] +user= +directory=/path/to/wikidata/directory/ +command=/usr/local/bin/gitit -f /usr/local/etc/gitit.conf +stdout_logfile=/var/log/supervisor/%(program_name)s.log +stderr_logfile=/var/log/supervisor/%(program_name)s.log +autorestart=true +``` + +supervisord is a service you can enable in +`/etc/rc.conf` + +```conf +# /etc/rc.conf +supervisord_enable="YES" +``` + +and then start with `service supervisord start` +when you get supervisord running, you can start a +supervisorctl shell, i.e. + +```sh +supervisorctl +supervisor> status +# outputs +gitit RUNNING pid 98057, uptime 0:32:27 +supervisor> start/restart/stop gitit +supervisor> exit +``` + +But there is one other little detail, in that when you try to +run gitit as a daemon like this, on FreeBSD it will fail because it can't +find git. But the symlink solution is easy enough. + +```csh +ln -s /usr/local/bin/git /usr/bin/ +``` diff --git a/site/freebsd_jails_on_freenas/index.html b/site/freebsd_jails_on_freenas/index.html index 53ce5e4..51a10cf 100644 --- a/site/freebsd_jails_on_freenas/index.html +++ b/site/freebsd_jails_on_freenas/index.html @@ -94,6 +94,8 @@
  • python
  • +
  • running gitit under the supervision of supervisord
  • + @@ -244,6 +246,47 @@ python.

    python

    For python3 virtualenv

    virtualenv-3.6 <directory>
    +
    + +

    running gitit under the supervision of supervisord

    +

    py27-supervisor and hs-gitit are available as pkg install, if you want to +run a gitit wiki.

    +

    gitit doesn't come with an init service. To generate a sample config, +run gitit --print-default-config > gitit.conf, and then if you want +you can reference gitit.conf by passing gitit the -f flag.

    +

    So for instance, after you install supervisord, add something like the +following to the end of /usr/local/etc/supervisord.conf, and create +the directory /var/log/supervisor/.

    +
    [program:gitit]
    +user=<user>
    +directory=/path/to/wikidata/directory/
    +command=/usr/local/bin/gitit -f /usr/local/etc/gitit.conf
    +stdout_logfile=/var/log/supervisor/%(program_name)s.log
    +stderr_logfile=/var/log/supervisor/%(program_name)s.log
    +autorestart=true
    +
    + +

    supervisord is a service you can enable in +/etc/rc.conf

    +
    # /etc/rc.conf
    +supervisord_enable="YES"
    +
    + +

    and then start with service supervisord start +when you get supervisord running, you can start a +supervisorctl shell, i.e.

    +
    supervisorctl
    +supervisor> status
    +# outputs
    +gitit                            RUNNING   pid 98057, uptime 0:32:27
    +supervisor> start/restart/stop gitit
    +supervisor> exit
    +
    + +

    But there is one other little detail, in that when you try to +run gitit as a daemon like this, on FreeBSD it will fail because it can't +find git. But the symlink solution is easy enough.

    +
    ln -s /usr/local/bin/git /usr/bin/
     
    diff --git a/site/index.html b/site/index.html index 8bd8d42..2823fc2 100644 --- a/site/index.html +++ b/site/index.html @@ -204,5 +204,5 @@ diff --git a/site/mkdocs/search_index.json b/site/mkdocs/search_index.json index dc087f2..ce72360 100644 --- a/site/mkdocs/search_index.json +++ b/site/mkdocs/search_index.json @@ -267,7 +267,7 @@ }, { "location": "/freebsd_jails_on_freenas/", - "text": "FreeBSD Jails on FreeNAS\n\n\nMostly a personal distillation for getting a FreeBSD\nJail up and running on FreeNAS.\n\n\nIn The FreeNAS WebGui, Create A New Jail\n\n\nThe default networking configuration, will give\nyour jail an ip address on the lan. For now, I've\ndecided to just share a pkg cache with each jail.\nNavigate to \nJails -> Storage -> Add Storage\n and\nadd the \npkg\n storage directory to \n/var/cache/pkg\n\ninside the jail. \n\n\nFor instance, on my local FreeNAS server,\nthe pkg directory is at /mnt/VolumeOne/pkg/.\n\n\nIf you ssh into the host server, you can type the command\n\njls\n, to list the jails. Based on the output of the\ncommand \njls\n, you can get a shell with \njexec \n\nof \njexec \n.\n\n\nupdating\n\n\nHow about the command \npkg audit -F\n? Downloads a\nlist of known security issues and checks your system\nagainst that.\n\n\nI would recommend, to myself anyway, to shell into\nthe new jail with \njexec\n, run \npkg upgrade\n to install any new packages,\nand then from the FreeNAS webgui, restart the jail. Although\nthe restarted jail will have a new jail number as reported by\nthe \njls\n command.\n\n\nlocale\n\n\nWhen you use \njexec\n to get a shell, you get an environment\nwith an utf_8 locale. Not so if you ssh into the new jail.\nFor this put the following contents into ~/.login_conf\n\n\n# ~/.login_conf\nme:\\\n :charset=UTF-8:\\\n :lang=en_US.UTF-8:\\\n :setenv=LC_COLLATE=C:\n\n\n\n\nssh\n\n\nTo get ssh running, edit \n/etc/rc.conf\n inside the jail.\n\n\n# /etc/rc.conf\nsshd_enable=\"YES\"\n\n\n\n\nTo start sshd immediately, make any necessary edits to\n/etc/ssh/sshd_config, and run the following command.\n\n\nservice sshd start\n\n\n\n\nByobu\n\n\nYou'll need newt to configure byobu, and if you don't install tmux\nthen screen will become the backend.\n\n\npkg install byobu tmux newt\n\n\n\n\nIf you execute \nbyobu-config\n, by pressing \nf9\n, the\nfollowing options seem to work. Some options, of course,\nwill prevent others from working so you have to enable them\none at a time to see what happens.\n\n\n\n\ndate\n\n\ndisk\n\n\ndistro\n\n\nhostname\n\n\nip address\n\n\nload_average\n\n\nlogo\n\n\ntime\n\n\nuptime\n\n\nusers\n\n\nwhoami\n\n\n\n\nvim\n\n\nVia pkg, there are two options: vim and vim-lite. Note vim will pull\nin a whole bunch of gui dependancies, but vim-lite is not build with python.\n\n\nFor instance, powerline will not work with vim-lite because it's not built with\npython. Also, vim-youcompleteme will not work with vim-lite. However, lightline\nwill work with vim-lite, and VimCompletesMe will work with vim-lite.\n\n\nTo get lightline working update $TERM\n\n\n# ~/.config/fish/config.fish\nexport TERM=xterm-256color\n\n\n\n\nAnd vimrc\n\n\n# ~/.vimrc\nset ls=2\n\n\n\n\nAnother option is to build vim from source via ports. You can prevent vim\nfrom pulling in a bunch of gui dependancies with the following in /etc/make.conf.\n\n\n# /etc/make.conf\nWITHOUT_X11=yes\n\n\n\n\nAnd then when you compile vim from ports, run \nmake config\n where you can enable\npython.\n\n\npython\n\n\nFor python3 virtualenv\n\n\nvirtualenv-3.6 ", + "text": "FreeBSD Jails on FreeNAS\n\n\nMostly a personal distillation for getting a FreeBSD\nJail up and running on FreeNAS.\n\n\nIn The FreeNAS WebGui, Create A New Jail\n\n\nThe default networking configuration, will give\nyour jail an ip address on the lan. For now, I've\ndecided to just share a pkg cache with each jail.\nNavigate to \nJails -> Storage -> Add Storage\n and\nadd the \npkg\n storage directory to \n/var/cache/pkg\n\ninside the jail. \n\n\nFor instance, on my local FreeNAS server,\nthe pkg directory is at /mnt/VolumeOne/pkg/.\n\n\nIf you ssh into the host server, you can type the command\n\njls\n, to list the jails. Based on the output of the\ncommand \njls\n, you can get a shell with \njexec \n\nof \njexec \n.\n\n\nupdating\n\n\nHow about the command \npkg audit -F\n? Downloads a\nlist of known security issues and checks your system\nagainst that.\n\n\nI would recommend, to myself anyway, to shell into\nthe new jail with \njexec\n, run \npkg upgrade\n to install any new packages,\nand then from the FreeNAS webgui, restart the jail. Although\nthe restarted jail will have a new jail number as reported by\nthe \njls\n command.\n\n\nlocale\n\n\nWhen you use \njexec\n to get a shell, you get an environment\nwith an utf_8 locale. Not so if you ssh into the new jail.\nFor this put the following contents into ~/.login_conf\n\n\n# ~/.login_conf\nme:\\\n :charset=UTF-8:\\\n :lang=en_US.UTF-8:\\\n :setenv=LC_COLLATE=C:\n\n\n\n\nssh\n\n\nTo get ssh running, edit \n/etc/rc.conf\n inside the jail.\n\n\n# /etc/rc.conf\nsshd_enable=\"YES\"\n\n\n\n\nTo start sshd immediately, make any necessary edits to\n/etc/ssh/sshd_config, and run the following command.\n\n\nservice sshd start\n\n\n\n\nByobu\n\n\nYou'll need newt to configure byobu, and if you don't install tmux\nthen screen will become the backend.\n\n\npkg install byobu tmux newt\n\n\n\n\nIf you execute \nbyobu-config\n, by pressing \nf9\n, the\nfollowing options seem to work. Some options, of course,\nwill prevent others from working so you have to enable them\none at a time to see what happens.\n\n\n\n\ndate\n\n\ndisk\n\n\ndistro\n\n\nhostname\n\n\nip address\n\n\nload_average\n\n\nlogo\n\n\ntime\n\n\nuptime\n\n\nusers\n\n\nwhoami\n\n\n\n\nvim\n\n\nVia pkg, there are two options: vim and vim-lite. Note vim will pull\nin a whole bunch of gui dependancies, but vim-lite is not build with python.\n\n\nFor instance, powerline will not work with vim-lite because it's not built with\npython. Also, vim-youcompleteme will not work with vim-lite. However, lightline\nwill work with vim-lite, and VimCompletesMe will work with vim-lite.\n\n\nTo get lightline working update $TERM\n\n\n# ~/.config/fish/config.fish\nexport TERM=xterm-256color\n\n\n\n\nAnd vimrc\n\n\n# ~/.vimrc\nset ls=2\n\n\n\n\nAnother option is to build vim from source via ports. You can prevent vim\nfrom pulling in a bunch of gui dependancies with the following in /etc/make.conf.\n\n\n# /etc/make.conf\nWITHOUT_X11=yes\n\n\n\n\nAnd then when you compile vim from ports, run \nmake config\n where you can enable\npython.\n\n\npython\n\n\nFor python3 virtualenv\n\n\nvirtualenv-3.6 \n\n\n\n\nrunning gitit under the supervision of supervisord\n\n\npy27-supervisor and hs-gitit are available as pkg install, if you want to\nrun a gitit wiki.\n\n\ngitit doesn't come with an init service. To generate a sample config,\nrun \ngitit --print-default-config > gitit.conf\n, and then if you want\nyou can reference gitit.conf by passing gitit the \n-f\n flag.\n\n\nSo for instance, after you install supervisord, add something like the\nfollowing to the end of \n/usr/local/etc/supervisord.conf\n, and create\nthe directory \n/var/log/supervisor/\n.\n\n\n[program:gitit]\nuser=\ndirectory=/path/to/wikidata/directory/\ncommand=/usr/local/bin/gitit -f /usr/local/etc/gitit.conf\nstdout_logfile=/var/log/supervisor/%(program_name)s.log\nstderr_logfile=/var/log/supervisor/%(program_name)s.log\nautorestart=true\n\n\n\n\nsupervisord is a service you can enable in\n\n/etc/rc.conf\n\n\n# /etc/rc.conf\nsupervisord_enable=\"YES\"\n\n\n\n\nand then start with \nservice supervisord start\n\nwhen you get supervisord running, you can start a\nsupervisorctl shell, i.e.\n\n\nsupervisorctl\nsupervisor> status\n# outputs\ngitit RUNNING pid 98057, uptime 0:32:27\nsupervisor> start/restart/stop gitit\nsupervisor> exit\n\n\n\n\nBut there is one other little detail, in that when you try to\nrun gitit as a daemon like this, on FreeBSD it will fail because it can't\nfind git. But the symlink solution is easy enough.\n\n\nln -s /usr/local/bin/git /usr/bin/", "title": "FreeBSD Jails on FreeNAS" }, { @@ -310,6 +310,11 @@ "text": "For python3 virtualenv virtualenv-3.6 ", "title": "python" }, + { + "location": "/freebsd_jails_on_freenas/#running-gitit-under-the-supervision-of-supervisord", + "text": "py27-supervisor and hs-gitit are available as pkg install, if you want to\nrun a gitit wiki. gitit doesn't come with an init service. To generate a sample config,\nrun gitit --print-default-config > gitit.conf , and then if you want\nyou can reference gitit.conf by passing gitit the -f flag. So for instance, after you install supervisord, add something like the\nfollowing to the end of /usr/local/etc/supervisord.conf , and create\nthe directory /var/log/supervisor/ . [program:gitit]\nuser=\ndirectory=/path/to/wikidata/directory/\ncommand=/usr/local/bin/gitit -f /usr/local/etc/gitit.conf\nstdout_logfile=/var/log/supervisor/%(program_name)s.log\nstderr_logfile=/var/log/supervisor/%(program_name)s.log\nautorestart=true supervisord is a service you can enable in /etc/rc.conf # /etc/rc.conf\nsupervisord_enable=\"YES\" and then start with service supervisord start \nwhen you get supervisord running, you can start a\nsupervisorctl shell, i.e. supervisorctl\nsupervisor> status\n# outputs\ngitit RUNNING pid 98057, uptime 0:32:27\nsupervisor> start/restart/stop gitit\nsupervisor> exit But there is one other little detail, in that when you try to\nrun gitit as a daemon like this, on FreeBSD it will fail because it can't\nfind git. But the symlink solution is easy enough. ln -s /usr/local/bin/git /usr/bin/", + "title": "running gitit under the supervision of supervisord" + }, { "location": "/arch_redis_nspawn/", "text": "Quick Dirty Redis Nspawn Container on Arch Linux\n\n\nRefer to the \nNspawn\n page for setting up the nspawn container,\ninstall redis, and start/enable redis.service.\nOnce you have the container running, it seems all you have to do to get\nthings working in a container subnet is to change the bind address.\n\n\n# /etc/redis.conf\n# bind 127.0.0.1\nbind 0.0.0.0\n\n\n\n\nyou can nmap port 6379, be sure to restart redis\n\n\nAgain I would refer you to the Arch Wiki", diff --git a/site/sitemap.xml b/site/sitemap.xml index 0ae399e..2ca9fe1 100644 --- a/site/sitemap.xml +++ b/site/sitemap.xml @@ -4,7 +4,7 @@ / - 2017-07-15 + 2017-07-16 daily @@ -12,7 +12,7 @@ /serve_and_share_apps_from_your_phone_with_fdroid/ - 2017-07-15 + 2017-07-16 daily @@ -20,7 +20,7 @@ /nspawn/ - 2017-07-15 + 2017-07-16 daily @@ -28,7 +28,7 @@ /mastodon_on_arch/ - 2017-07-15 + 2017-07-16 daily @@ -36,7 +36,7 @@ /debian_nspawn_container_on_arch_for_testing_apache_configurations/ - 2017-07-15 + 2017-07-16 daily @@ -44,7 +44,7 @@ /dynamic_cacheing_nginx_reverse_proxy_for_pacman/ - 2017-07-15 + 2017-07-16 daily @@ -52,7 +52,7 @@ /freebsd_jails_on_freenas/ - 2017-07-15 + 2017-07-16 daily @@ -60,7 +60,7 @@ /arch_redis_nspawn/ - 2017-07-15 + 2017-07-16 daily @@ -68,7 +68,7 @@ /arch_postgresql_nspawn/ - 2017-07-15 + 2017-07-16 daily @@ -76,7 +76,7 @@ /self_signed_certs/ - 2017-07-15 + 2017-07-16 daily