= syncpkgcd(1)

== NAME

syncpkgcd - a client daemon that fetches requests from a syncpkg daemon

== SYNOPSIS

syncpkgcd [options]

== OPTIONS

-l, --logfile::
	Set the logfile (default: syncpkgcd.log).

-p, --pidfile::
	Set the pidfile (default: syncpkgcd.pid).

-u	--uid::
	Set the daemon's user id.

== DESCRIPTION

To set up syncpkgcd, you need the followings.

* First, check your firewall: outgoing connections to `git.frugalware.org`
should be allowed on ports 22 and 80. (If you use the default Frugalware
firewall configuration then no changes are needed.)

* Second, you need to edit the server_url, server_user and server_pass variables
in /etc/syncpkgcd/cconfig.py. In most cases we (the Frugalware developers)
provide the syncpkgd server, so contact us to get an account.

* Now switch to the syncpkgd user, using:

----
# mkdir -p /home/syncpkgd
# chown syncpkgd.daemon /home/syncpkgd
# su - syncpkgd
----

* Generate an ssh key with no passphrase, using:

----
$ ssh-keygen -t rsa
----

NOTE: The `\~/.ssh/id_rsa.pub` file should be appended to `\~/.ssh/authorized_keys` on
the server with a `command="syncpkg-shell <nick>" ` prefix.

* Now login to git.frugalware.org manually so that the fingerprint of the
  servers will be added to the `\~/.ssh/known_hosts` file.

* You need to create the <fst_root> directory:

----
$ mkdir -p ~/repos
----

* You are done with the user configuration, switch back to root and check if
  the line

----
syncpkgd ALL=(ALL) NOPASSWD: /usr/bin/makepkg
----

is in `/etc/sudoers`. It should be, if you installed the `pacman-tools` package
and you haven't commented it out.

Also, if you set the `CHROOTDIR` in `/etc/makepkg.conf` to be
`$HOME`-dependent, then make sure to set

----
Defaults env_keep += "HOME"
----

in `/etc/sudoers` as well.

* Finally you can enable and start syncpkgcd as root:

----
# systemctl enable syncpkgcd.service
# systemctl start syncpkgcd.service
----

NOTE: You may want to check `/var/log/syncpkgcd.log` to see if everything works as
expected.
