-
-
Save CauanCabral/5967374 to your computer and use it in GitHub Desktop.
[Unit] | |
Description=Gearman Job Server | |
Wants=network.target | |
[Service] | |
ExecStart=/usr/local/sbin/gearmand \ | |
--daemon \ | |
--listen=127.0.0.1 \ | |
--pid-file=/var/run/gearman/gearmand.pid \ | |
--log-file=/var/log/gearman/gearmand.log | |
# Example with MySQL Persistent | |
# -q MySQL \ | |
# --mysql-host=localhost \ | |
# --mysql-port=3306 \ | |
# --mysql-user=mygearman \ | |
# --mysql-password=mypass \ | |
# --mysql-db=gearman \ | |
# --mysql-table=gearman_queue | |
# Example with Postgres Persistent | |
# -q Postgres \ | |
# --libpq-conninfo "hostaddr=127.0.0.1 port=5432 dbname=gearman user=mygearman password=mypass" | |
# --libpq-table=queue | |
Type=forking | |
[Install] | |
WantedBy=multi-user.target |
#!/bin/bash | |
clear | |
echo "Install gearman dependencies ------------------------------" | |
zypper in -l --recommends gcc-g++ boost-devel gperf libevent-devel postgresql-devel libmysqlclient-devel libuuid-devel | |
clear | |
echo "Download gearman-------------------------------------------" | |
wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz | |
clear | |
echo "Upnziping gearman------------------------------------------" | |
tar -zxf gearmand-1.1.12.tar.gz | |
cd gearmand-1.1.12 | |
clear | |
echo "Configure gearman------------------------------------------" | |
./configure --with-postgresql=/usr/bin/pg_config --with-mysql=/usr/bin/mysql_config | |
clear | |
echo "Compile and install----------------------------------------" | |
make && make install | |
clear | |
echo "Create user and group--------------------------------------" | |
useradd -r -s /bin/bash -g gearman gearman | |
echo "Create system directories----------------------------------" | |
mkdir -p /var/run/gearman /var/log/gearman | |
chown gearman /var/run/gearman | |
chown gearman /var/log/gearman | |
clear | |
echo "Install Sytemd Service for Gearman" | |
cd .. | |
wget https://gist.github.com/CauanCabral/5967374/raw/9ca1a323ccc6c58fecbba7b6fe60420f255a46cd/gearmand.service | |
cp gearmand.service /etc/systemd/system/gearmand.service | |
systemctl enable gearmand.service | |
clear | |
echo "Install PHP extension for gearman--------------------------" | |
pecl install gearman | |
src=`find /usr/ -name 'gearman.so' 2> /dev/null` | |
echo extension=\"$src\" >> /etc/php5/conf.d/gearman.ini |
Without that configure didn't found PostgreSQL and MySQL info and queue is not avaliable after install.
I'm not sure if your interested in feedback, for me this didn't worked on OpenSUSE 13.1 (clean new installation). Had to install: gcc and clang librarys, uuid-devel libuuid libuuid-devel boost-devel libevent libevent-devel libconfig-devel libconfig++9 libconfig9 gcc48-c++ to get this running.
On my older SUSE I can start gearamnd-jobserver by using "gearmand" or "gearmand -d" command. Don't get this running here. Any idea?
Don't have any idea.
For me that's not working anymore - today I've to install version 1.0.6 ( https://gist.github.com/CauanCabral/6a2dc367a7695c89b0b4 ).
I'll try again with your advices, thank you.
I've changed a litle bit the script and it's working for me now. Please, try again.
I think you meant gcc-c++ on your zypper install.. Not sure exactly what a compiler for google plus would do.. ;)
Is there a reason why "./configure --with-postgresql=/usr/bin/pg_config --with-mysql=/usr/bin/mysql_config" instead of ./configure only? Regards.