PLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. fblanchard
  2. PLCnext Engineer
  3. Sunday, 21 June 2020

Hello,

What is the best practice to start a C# DotNet service using SysvInit ?  I would prefer using use a modern system like “systemd”, but as your Yocto configuration comes with SysvInit, and that there is not much documentation on how using this service framework to start dotnet application, I wonder if you know how to do it.

I am fully open to suggestions.

(Note that I already know how to start a dotnet console app on PLCnext and know the basic of SysvInit).

Thanks,

Frédéric

Using 2020.0.1 framework

Accepted Answer
fblanchard Accepted Answer Pending Moderation
0
Votes
Undo

I finally made it work using traditional SysVinit scripting (i.e. without using the command "start-stop-daemon" like the nginx script does)

Oliver PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hello Frederic,

I dont think that this is anything different for .NetCore binaries then for other System Init Processes.
So the best practice for init.d is to provide a update-rc compatible init script and using the start-stop-daemon to setup your binary.

Search for Sysv init.d tutorials and update-rc.

/etc/init.d/skeleton

#! /bin/sh
  ### BEGIN INIT INFO
  # Provides: skeleton
  # Required-Start: $remote_fs $syslog
  # Required-Stop: $remote_fs $syslog
  # Default-Start: 2 3 4 5
  # Default-Stop: 0 1 6
  # Short-Description: Example initscript
  # Description: This file should be used to construct scripts to be
  # placed in /etc/init.d.
  ### END INIT INFO
   
  # Author: Foo Bar <foobar@baz.org>;
  #
  # Please remove the "Author" lines above and replace them
  .# with your own name if you copy and modify this script.
....
...

....


Depending on your application you might also think about providing it as a Daemon App.
For easier deployment to your PLCs via the WBM...


https://github.com/PLCnext/PLCnextAppExamples/tree/public/DemoApps

 

Phoenix Contact Electronics Headquarter - PLCnext Runtime Product Management and Support

  1. more than a month ago
  2. PLCnext Engineer
  3. # 1
fblanchard Accepted Answer Pending Moderation
0
Votes
Undo

Thanks Oliver.  I will look at theses examples soon.

  1. more than a month ago
  2. PLCnext Engineer
  3. # 2
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.