bitbake support outside a OE-core or poky (yocto) environment is quite annoying. No distribution that I have used so far could write a decent package containing all dependencies and fixing PYTHONPATH problems in run-time.
Why I did need this? Because I wanted to run bitbake’s prserv as a standalone server in a build server. In order to do that I had to create an Arch package + systemd service file.
You can check out Arch support for bitbake in AUR. Also it might give a better understanding for other distributions as well.
Now for systemd, create a file /usr/lib/systemd/system/bitbake-prserv.service and add the following content.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[Unit] Description=Bitbake's PR Service After=network.target remote-fs.target nss-lookup.target [Service] Type=forking Environment=PRSERV_PORT=39411 PYTHONPATH=/usr/lib/python2.7/site-packages/bb # PIDFile must contain the $PRSERV_PORT value PIDFile=/tmp/PRServer_0.0.0.0_39411.pid ExecStart=/usr/bin/bitbake-prserv --start --port=${PRSERV_PORT} --file=/path/to/prserv.sqlite3 --log=/path/to/prserv.log ExecStop=/usr/bin/bitbake-prserv --stop --port=${PRSERV_PORT} [Install] WantedBy=multi-user.target |
Make sure that the port is accessible via tcp on your firewall (39411 used here is just a random number). Also, you can notice that I couldn’t find a way to use $PRSERV_PORT in PIDFile= option. If you know a better solution, please share with us.