Possibility to inject a script to run my service executable #112

Closed
opened 2026-01-29 16:29:52 +00:00 by claunia · 1 comment
Owner

Originally created by @Dirk-Kuypers on GitHub (Dec 10, 2021).

And another question: I have to add two environment variables before starting my service I want to install with the Debian package. Is there a way to achieve that? The scripts I see at the moment are only to be injected on installation/uninstallation.

Originally created by @Dirk-Kuypers on GitHub (Dec 10, 2021). And another question: I have to add two environment variables before starting my service I want to install with the Debian package. Is there a way to achieve that? The scripts I see at the moment are only to be injected on installation/uninstallation.
Author
Owner

@Dirk-Kuypers commented on GitHub (Dec 16, 2021):

Meanwhile I was able to achieve what I wanted. Maybe this should also go to the docs, but I am not sure if it is too specific. I used a PostInstallScript:

   <PostInstallScript>
      <![CDATA[
rm -f /usr/local/bin/my-app
mv /usr/share/my-app/my-app.sh /usr/local/bin/my-app
chmod 755 /usr/local/bin/my-app
systemctl daemon-reload
systemctl enable --now my-app.service
systemctl my-app
       ]]>
    </PostInstallScript>  
@Dirk-Kuypers commented on GitHub (Dec 16, 2021): Meanwhile I was able to achieve what I wanted. Maybe this should also go to the docs, but I am not sure if it is too specific. I used a PostInstallScript: ``` <PostInstallScript> <![CDATA[ rm -f /usr/local/bin/my-app mv /usr/share/my-app/my-app.sh /usr/local/bin/my-app chmod 755 /usr/local/bin/my-app systemctl daemon-reload systemctl enable --now my-app.service systemctl my-app ]]> </PostInstallScript> ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#112