Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.38 KB

README.md

File metadata and controls

40 lines (32 loc) · 1.38 KB

Create an RPM with a systemd service via CPack

This project uses CPack to create an RPM containing a systemd service. I'm a novice when in comes to creating RPMs- caveat emptor.

Here's a utilitarian user's guide:

# Clone, build, and package the project.
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/hello-world-service
make package

# Go ahead and install the RPM.
ls *.rpm
yum install ./hello-world-0.1-Linux.rpm

# Check the status of the service - should be stopped.
systemctl status hello-world

# Start the service, then check its status.
systemctl start hello-world
systemctl status hello-world

# Removing the RPM should cleanup all traces.
yum remove hello-world
systemctl status hello-world

Upgrading from 0.1...

This project was fixed to support upgrades to the RPM package. If you're creating your own RPMs, I strongly recommend testing the upgrade process before shipping.

References