{"action":"created","issue":{"url":"https://api.github.com/repos/error10/bitcoin/issues/5","labels_url":"https://api.github.com/repos/error10/bitcoin/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/error10/bitcoin/issues/5/comments","events_url":"https://api.github.com/repos/error10/bitcoin/issues/5/events","html_url":"https://github.com/error10/bitcoin/issues/5","id":59226425,"number":5,"title":"Few problems (and solutions) with the systemd scripts on CentOS 7","user":{"login":"kaipila","id":1137974,"avatar_url":"https://avatars.githubusercontent.com/u/1137974?v=3","gravatar_id":"","url":"https://api.github.com/users/kaipila","html_url":"https://github.com/kaipila","followers_url":"https://api.github.com/users/kaipila/followers","following_url":"https://api.github.com/users/kaipila/following{/other_user}","gists_url":"https://api.github.com/users/kaipila/gists{/gist_id}","starred_url":"https://api.github.com/users/kaipila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaipila/subscriptions","organizations_url":"https://api.github.com/users/kaipila/orgs","repos_url":"https://api.github.com/users/kaipila/repos","events_url":"https://api.github.com/users/kaipila/events{/privacy}","received_events_url":"https://api.github.com/users/kaipila/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-27T11:49:41Z","updated_at":"2015-02-27T19:19:58Z","closed_at":null,"body":"Hello.\r\n\r\nTrying to get the bitcoind to run as a service I ran in to couple of problems, found work arounds and though you should be aware of these. This is all on CentOS 7.\r\n\r\n1. PID file\r\n\r\nSince the service is ran as the bitcoin user it can't create the PID file under /var/run nor /run. For some reason /etc/sysconfig/bitcoin was referring to /var/run and /usr/lib/systemd/system/bitcoin.service was pointing to /run which was also strange. So, I changed the /etc/sysconfig/bitcoin to:\r\n\r\nPID_FILE=\"/var/lib/bitcoin/bitcoind.pid\"\r\n\r\nAlso, this change had to be represented in /usr/lib/systemd/system/bitcoin.service, so I changed:\r\n\r\nPIDFile=/var/lib/bitcoin/bitcoind.pid\r\n\r\n2. Error: Specified data directory \"$DATA_DIR\" does not exist.\r\n\r\nSeeing these messages in my /var/log/messages I went ahead and made some additional changes in the /usr/lib/systemd/system/bitcoin.service, namely the ExecStart line I changed to:\r\n\r\nExecStart=/usr/sbin/bitcoind -daemon -conf=${CONFIG_FILE} -datadir=${DATA_DIR} -pid=${PID_FILE} $OPTIONS\r\n\r\nAfter these two changes I got everything running."},"comment":{"url":"https://api.github.com/repos/error10/bitcoin/issues/comments/76454564","html_url":"https://github.com/error10/bitcoin/issues/5#issuecomment-76454564","issue_url":"https://api.github.com/repos/error10/bitcoin/issues/5","id":76454564,"user":{"login":"error10","id":198207,"avatar_url":"https://avatars.githubusercontent.com/u/198207?v=3","gravatar_id":"","url":"https://api.github.com/users/error10","html_url":"https://github.com/error10","followers_url":"https://api.github.com/users/error10/followers","following_url":"https://api.github.com/users/error10/following{/other_user}","gists_url":"https://api.github.com/users/error10/gists{/gist_id}","starred_url":"https://api.github.com/users/error10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/error10/subscriptions","organizations_url":"https://api.github.com/users/error10/orgs","repos_url":"https://api.github.com/users/error10/repos","events_url":"https://api.github.com/users/error10/events{/privacy}","received_events_url":"https://api.github.com/users/error10/received_events","type":"User","site_admin":false},"created_at":"2015-02-27T19:19:58Z","updated_at":"2015-02-27T19:19:58Z","body":"Hi again,\r\n\r\nMy aim with this repo is to produce packages that will eventually be able to ship officially as part of the Fedora and Red Hat Enterprise Linux distributions. As such I try to build them in accordance with the distribution [packaging guidelines](http://fedoraproject.org/wiki/Packaging:Guidelines). One of those is that all files must be in [standard locations](http://fedoraproject.org/wiki/Packaging:Guidelines#Filesystem_Layout).\r\n\r\nIt was easy enough to fix the problem with the PID file, as it turns out systemd will create a directory under /run for bitcoind to use and give it the proper permissions. This is working its way through the build server now, and will be released as 0.10.0-2 later tonight."}}