Merge "Add sample systemd service files."

This commit is contained in:
Zuul 2018-04-16 18:07:59 +00:00 committed by Gerrit Code Review
commit d4e2d97986
7 changed files with 96 additions and 132 deletions

View File

@ -39,135 +39,3 @@ Install Zookeeper
sudo dnf install zookeeper -y
sudo cp /etc/zookeeper/zoo_sample.cfg /etc/zookeeper/zoo.cfg
Service Management
------------------
Zookeeper Service Management
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
sudo systemctl start zookeeper.service
::
sudo systemctl status zookeeper.service
● zookeeper.service - Apache ZooKeeper
Loaded: loaded (/usr/lib/systemd/system/zookeeper.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2018-01-03 14:53:47 UTC; 5s ago
Process: 4153 ExecStart=/usr/bin/zkServer.sh start zoo.cfg (code=exited, status=0/SUCCESS)
Main PID: 4160 (java)
Tasks: 17 (limit: 4915)
CGroup: /system.slice/zookeeper.service
└─4160 java -Dzookeeper.log.dir=/var/log/zookeeper -Dzookeeper.root.logger=INFO,CONSOLE -cp /usr/share/java/
::
sudo systemctl enable zookeeper.service
Nodepool Service Management
~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
sudo bash -c "cat > /etc/systemd/system/nodepool-launcher.service <<EOF
[Unit]
Description=Nodepool Launcher Service
After=syslog.target network.target
[Service]
Type=simple
# Options to pass to nodepool-launcher.
Group=nodepool
User=nodepool
RuntimeDirectory=nodepool
ExecStart=/usr/local/bin/nodepool-launcher
[Install]
WantedBy=multi-user.target
EOF"
sudo chmod 0644 /etc/systemd/system/nodepool-launcher.service
Zuul Service Management
~~~~~~~~~~~~~~~~~~~~~~~
::
sudo bash -c "cat > /etc/systemd/system/zuul-scheduler.service <<EOF
[Unit]
Description=Zuul Scheduler Service
After=syslog.target network.target
[Service]
Type=simple
Group=zuul
User=zuul
RuntimeDirectory=zuul
ExecStart=/usr/local/bin/zuul-scheduler
ExecStop=/usr/local/bin/zuul-scheduler stop
[Install]
WantedBy=multi-user.target
EOF"
sudo bash -c "cat > /etc/systemd/system/zuul-executor.service <<EOF
[Unit]
Description=Zuul Executor Service
After=syslog.target network.target
[Service]
Type=simple
Group=zuul
User=zuul
RuntimeDirectory=zuul
ExecStart=/usr/local/bin/zuul-executor
ExecStop=/usr/local/bin/zuul-executor stop
[Install]
WantedBy=multi-user.target
EOF"
sudo bash -c "cat > /etc/systemd/system/zuul-web.service <<EOF
[Unit]
Description=Zuul Web Service
After=syslog.target network.target
[Service]
Type=simple
Group=zuul
User=zuul
RuntimeDirectory=zuul
ExecStart=/usr/local/bin/zuul-web
ExecStop=/usr/local/bin/zuul-web stop
[Install]
WantedBy=multi-user.target
EOF"
sudo chmod 0644 /etc/systemd/system/zuul-scheduler.service
sudo chmod 0644 /etc/systemd/system/zuul-executor.service
sudo chmod 0644 /etc/systemd/system/zuul-web.service
Starting Services
~~~~~~~~~~~~~~~~~
After you have Zuul and Nodepool installed and configured, you can start
those services with::
sudo systemctl daemon-reload
sudo systemctl start nodepool-launcher.service
sudo systemctl status nodepool-launcher.service
sudo systemctl enable nodepool-launcher.service
sudo systemctl start zuul-scheduler.service
sudo systemctl status zuul-scheduler.service
sudo systemctl enable zuul-scheduler.service
sudo systemctl start zuul-executor.service
sudo systemctl status zuul-executor.service
sudo systemctl enable zuul-executor.service
sudo systemctl start zuul-web.service
sudo systemctl status zuul-web.service
sudo systemctl enable zuul-web.service

View File

@ -10,3 +10,12 @@ Install Nodepool
cd nodepool/
sudo dnf -y install $(bindep -b)
sudo pip3 install .
Service File
------------
Nodepool includes a systemd service file for nodepool-launcher in the ``etc``
source directory. To use it, do the following steps::
$ sudo cp etc/nodepool-launcher.service /etc/systemd/system/nodepool-launcher.service
$ sudo chmod 0644 /etc/systemd/system/nodepool-launcher.service

View File

@ -62,6 +62,35 @@ further restrict public access.
name: quickstart
EOF"
Starting Services
-----------------
Your system software management should have installed the Zookeeper service
files for you.
After you have Zuul and Nodepool installed and configured, you can start
all of the services with::
sudo systemctl daemon-reload
sudo systemctl start zookeeper.service
sudo systemctl status zookeeper.service
sudo systemctl enable zookeeper.service
sudo systemctl start nodepool-launcher.service
sudo systemctl status nodepool-launcher.service
sudo systemctl enable nodepool-launcher.service
sudo systemctl start zuul-scheduler.service
sudo systemctl status zuul-scheduler.service
sudo systemctl enable zuul-scheduler.service
sudo systemctl start zuul-executor.service
sudo systemctl status zuul-executor.service
sudo systemctl enable zuul-executor.service
sudo systemctl start zuul-web.service
sudo systemctl status zuul-web.service
sudo systemctl enable zuul-web.service
Use Zuul Jobs
-------------

View File

@ -23,3 +23,16 @@ Initial Setup
sudo chmod 0700 /var/lib/zuul/.ssh
sudo mv nodepool_rsa /var/lib/zuul/.ssh
sudo chown -R zuul.zuul /var/lib/zuul/.ssh
Service Files
-------------
Zuul includes some systemd service files for Zuul in the ``etc`` source
directory. To use them, do the following steps::
$ sudo cp etc/zuul-scheduler.service /etc/systemd/system/zuul-scheduler.service
$ sudo cp etc/zuul-executor.service /etc/systemd/system/zuul-executor.service
$ sudo cp etc/zuul-web.service /etc/systemd/system/zuul-web.service
$ sudo chmod 0644 /etc/systemd/system/zuul-scheduler.service
$ sudo chmod 0644 /etc/systemd/system/zuul-executor.service
$ sudo chmod 0644 /etc/systemd/system/zuul-web.service

15
etc/zuul-executor.service Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description=Zuul Executor Service
After=syslog.target network.target
[Service]
Type=forking
Group=zuul
User=zuul
RuntimeDirectory=zuul
ExecStart=/usr/local/bin/zuul-executor
ExecStop=/usr/local/bin/zuul-executor stop
PIDFile=/var/run/zuul/executor.pid
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,15 @@
[Unit]
Description=Zuul Scheduler Service
After=syslog.target network.target
[Service]
Type=forking
Group=zuul
User=zuul
RuntimeDirectory=zuul
ExecStart=/usr/local/bin/zuul-scheduler
ExecStop=/usr/local/bin/zuul-scheduler stop
PIDFile=/var/run/zuul/scheduler.pid
[Install]
WantedBy=multi-user.target

15
etc/zuul-web.service Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description=Zuul Web Service
After=syslog.target network.target
[Service]
Type=forking
Group=zuul
User=zuul
RuntimeDirectory=zuul
ExecStart=/usr/local/bin/zuul-web
ExecStop=/usr/local/bin/zuul-web stop
PIDFile=/var/run/zuul/web.pid
[Install]
WantedBy=multi-user.target