Commit 14f2bd2 1 parent 1f9f41b commit 14f2bd2 Copy full SHA for 14f2bd2
File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,33 @@ Per default a symlink will by created in /usr/local/bin pointing to your applica
98
98
my-app
99
99
```
100
100
101
+ ## Creating a Systemd Service
102
+
103
+ Add a ` my-app.service ` file to your project containing at least the following
104
+
105
+ ```
106
+ [Unit]
107
+ Description=My awesome app
108
+
109
+ [Service]
110
+ Type=simple
111
+ ExecStart=/usr/local/bin/my-app
112
+
113
+ [Install]
114
+ WantedBy=multi-user.target
115
+ ```
116
+
117
+ Add the ` my-app.service ` file to an ` <ItemGroup> ` of your ` .csproj ` with the following content to make sure that it is installed at the right place.
118
+
119
+ ```
120
+ <Content Include="my-app.service" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="1755">
121
+ <LinuxPath>/etc/systemd/system/my-app.service</LinuxPath>
122
+ </Content>
123
+ ```
124
+
125
+ Make sure to set the Property ` <InstallService>true</InstallService> ` in your ` .csproj ` file.
126
+
127
+
101
128
### Note
102
129
You can invoke the packaging tools manually, using a MSBuild target instead of using the a .NET Core CLI tool:
103
130
You can’t perform that action at this time.
0 commit comments