I have looked around, and I am afraid it's not possible, but maybe someone has an idea or some kind of workaround:
Is there any way to run services via systemctl on a bitbucket pipeline ?
I have code that generates service files and runs them via systemctl. I want to automate some tests by running that code which specifically calls systemctl.
typically, is it possible to run, on a pipeline, smth like this code:
serviceCmd = "sudo systemctl start " + serviceName;
std::system(serviceCmd)
any help would be appreciated Thanks
Adding this for any future people who might ask themselves the same:
As it happens, on Ubuntu 20 and Ubuntu 22 (not on CentOS 7.9 noor Ubuntu 18 though), you can simply install systemctl via
And any usage of systemctl seems to be working. I had to add a little hack though because I kept having an error message stating
To fix this, I did this in my DockerFile
so basically remove the + sign in the
man-db.servicefile