mirror of
https://github.com/quamotion/dotnet-packaging.git
synced 2026-02-15 13:46:36 +00:00
Add ability to create rpm services #85
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Mikalai on GitHub (Aug 14, 2020).
RPM service requires .service file that should be placed in /etc/systemd/system/ but it is not clear how to specify this using dotnet-packaging.
@qmfrederik commented on GitHub (Aug 17, 2020):
You can deploy files to any location by setting the
LinuxPathattribute:@Mikalai commented on GitHub (Aug 18, 2020):
@qmfrederik Thanks a lot, that works.
Maybe you can also clarify if it is possible to specify custom bash script after rpm package is installed or maybe there is a document with all the features that can be used? For example is it possible to call
systemclt daemon-reloadandsystemctl enable .service and start?Also when building rpm package with rpmbuild on centos it is possible to call
dotnet publish -c release -r rhel-x64 --self-containedAnd when rpm package is build it doesn't have any dependencies. When rpm is build with dotnet packaging during installation
are needed to be installed.
@marinovdh commented on GitHub (Jan 13, 2021):
I'm also figuring out how to get the service disabled/restarted from the package with the preinst and postinst scripts. But I can't find how it's been done. I see the code internally but I don't see how to trigger it with
dotnet debordotnet msbuildwith the right parameters. Does anyone know?@atauenis commented on GitHub (Jan 13, 2021):
@marinovdh
Also it is need to the csproj file have UNIX line endings.
@marinovdh commented on GitHub (Jan 13, 2021):
@atauenis Thanks for the info. I tried putting the above script in my .csproj (within the
<project>tag) but then I can't build the project. Is this the right place to put it?Also, I code in Visual Studio 2019 (v16.8.3) on a Windows machine. So I don't have UNIX line endings locally. My build server is on Linux so there it won't be a problem. But could that be a (different) issue?
@Skovvart commented on GitHub (Jan 13, 2021):
@marinovdh I am fairly sure these are properties that should be inside a
<PropertyGroup>block. E.g.I am also fairly certain that you will still need to have Linux file endings in the
CDATAblocks regardless that you're on windows, as the contents will be put into a file that needs to be interpreted by Linux.@atauenis commented on GitHub (Jan 13, 2021):
Line endings can be easily changed in any text editor when the .csproj is closed in Visual Studio. For example, AkelPad or Geany. VS 2019 correctly understand both UNIX-style and DOS-style line endings.
@marinovdh commented on GitHub (Jan 14, 2021):
@Skovvart Thanks, putting it in a
PropertyGroupin my .csproj did the trick.I also changed my line endings to UNIX style (with Geany) like @atauenis suggested. Only I don't see any changes in my created .deb package. My .deb file contains the data.tar file. What I expected was that the
data.tarwould now contain a filepostinstandpreinstin the root, but it's nowhere to be found in the file. What am I missing here?@atauenis commented on GitHub (Jan 14, 2021):
Not all archivers for Windows can correctly display .deb package content.

7-zip (and its plugin for Total Commander) only sees what will be installed (e.g.
/usr/share/myapp/or thedata.tar).WinRAR, however, can only see control files including scripts (or the
control.tar).@marinovdh commented on GitHub (Jan 14, 2021):
Aah! That explains a lot. Thanks. I use 7zip and wasn't aware that this archiver doesn't show all files. Thanks. 👍