3

I am building a deb package (openstack-swift-account) and have dumped a bunch of service files in my debian directory.

I need to bundle all the .service files in my package but, by default, it picks only the one which matches the package name.

I tried to play around with db_installinit, but could not get it to work

override_dh_installinit:
    dh_installinit --no-start
    dh_installinit --no-start -popenstack-swift-account --name=openstack-swift-account-auditor

I have named my service file as openstack-swift-account.openstack-swift-account-auditor.service in debian folder. There are many others like these

How do I achieve this?

2

Found the solution here :)

I posted the method in the comment over there, but I'll repeat here

Name the .service files as follows under the debian directory

<package1>.<service1>.service
<package1>.<service2>.service
<package2>.<service3>.service
... and so on

Then in override section

override_dh_installinit:
    dh_installinit -p<package1> --name=<service1>
    dh_installinit -p<package1> --name=<service2>
    dh_installinit -p<package2> --name=<service3>

The key is to not specify the .service extension in the --name parameter, provide the package name under which the file should be bundled as -p<package-name>, and name the .service as <package-name>.<service-name>.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.