pruiz / Topshelf.Linux

Topshelf extensions allowing compatibility with mono/linux.
Apache License 2.0
41 stars 14 forks source link

Full-lifecycle #10

Closed VoidMonk closed 7 years ago

VoidMonk commented 7 years ago

Hi, having read the brief repo doc, I'm assuming that this package only allows TopShelf's start and stop commands under Linux.

I'm trying to figure out what's the best approach to support the full-lifecycle for a Windows Service under Linux & Mono:

Is this package still needed in both the two cases? Some clarity on the required components and process will be useful.

Thanks.

pruiz commented 7 years ago

Well, it depends on how you package/distribute your app or component.

What we do is package the app as a rhel/centos rpm file, which includes an initrc script in charge of invoking mono-service, and read some env variables from /etc/sysconfig/$your.app.name$

Once we start moving towards centos7, we will have to provide something similiar as systemd's units, thought.

VoidMonk commented 7 years ago

Thanks Pablo. We basically package our app (.NET Windows Service) as a .tar. It includes the .exe, .config and .dll's. So, I guess we'll have to use both, mono-service to run the service and a Linux init system to take care of background process as well as server restarts.

But do we need TopShelf.Linux in that case? Can't the TopShelf-based service run with mono-service on Linux?

pruiz commented 7 years ago

I am not sure I understand you question. Yes, TopShelf does work with mono-service oob. It is TopShelf's ServiceBase-derived code which gets called by mono-service..

VoidMonk commented 7 years ago

Cool, I know that mono-service invokes TopShelf's ServiceBase code. My question, and confusion, is what is TopShelf.Linux used for? Where does it fit in?

pruiz commented 7 years ago

It fits in making TopShelf's service code being usable under linux (when used with mono-service). Maybe I do not understand your question, thought.

VoidMonk commented 7 years ago

Got it, thanks.