Frank-KunLi / cpack-systemd-demo

A demo project that uses CPack to build an RPM containing a systemd service.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

References

About

A demo project that uses CPack to build an RPM containing a systemd service.


Languages

Language:CMake 65.0%Language:Shell 26.3%Language:C++ 8.7%