Solaris daemon runlevels - solaris

There is this service I need to start up automatically whenever the my solaris server is restarted. I know I should set the runlevel as 3, but will it matter if I set the service to run on all runlevels(0 to 6)? if so, what would be the problem if I do that?

Important documentation for migrating from runlevels to SMF - http://docs.oracle.com/cd/E36784_01/html/E36820/index.html (Managing System Services in Oracle Solaris 11.2) and
http://docs.oracle.com/cd/E36784_01/html/E36883/smf-5.html#scrolltoc
which is the manpage describing the SMF facility in general.

Related

How to make node-red run 24/7 on Raspberry Pi

I want to host node-red 24/7 on Raspberry Pi. Something was running it constantly, then, the power had gone out, then it came back. But, then, the data was not coming.
I want the node-red to run constantly (at least when the raspberry pi is running). I tried making an .SH file to make it constantly run, here is the code:
node-red
that is the command prompt line to run node-red.
That did not work, is there something that I can do about this?
What you're looking for is a process manager, there are many process managers available each with their own features.
Natively many linux distributions support this functionality via a system called systemd also called an init system.
Docker as a system is also an option but this may be excessive for your use-case.
Some popular process manager applications are:
supervisord
PM2
Additional reading:
A supervisord tutorial on Digital Ocean by Alex Garnett
A systemd tutorial on Digital Ocean by Justin Ellingwood
The node-red install instructions for raspberry pi cover the in the running as a service section
https://nodered.org/docs/getting-started/raspberrypi#running-as-a-service
It is most likely that you had used node-red-start to start Node-RED as a service, but you had not completed the latter step to enable the service to start on boot.
Autostart on boot
If you want Node-RED to run when the Pi is turned on, or re-booted,
you can enable the service to autostart by running the command:
sudo systemctl enable nodered.service
To disable the service, run the command:
sudo systemctl disable nodered.service

How to run MirrorMaker 2.0 in production?

From the documentation, I see MirrorMaker 2.0 like this on the command line -
./bin/connect-mirror-maker.sh mm2.properties
In my case I can go to an EC2 instance and enter this command.
But what is the correct practice if this needs to run for many days. It is possible that EC2 instance can get terminated etc.
Therefore, I am trying to find out what are best practices if you need to run MirrorMaker 2.0 for a long period and want to make sure that it is able to stay up and running without any manual intervention.
You have many options, these include:
Add it as a service to systemd. Then you can specify that it should be started automatically and restarted on failure. systemd is very common now, but if you're not running systemd, there are many other process managers. https://superuser.com/a/687188/80826.
Running in a Docker container, where you can specify a restart policy.

Is it possible to have a Kafka cluster with different OSes?

If I have one Kafka running on Windows server, and another Kafka running on Linux server, and the last one running on a Unix server, can I use those three as one cluster?
Server A - Windows
Server B - Linux
Server C - Unix
Can I use them for replication? As in --replication-factor 3?
Brokers communicate via well defined APIs that don't depend on the operating system, so in theory that should work. However, I doubt anybody has tried running such a cluster!
It's worth noting that Windows is not an officially supported platform: http://kafka.apache.org/documentation/#os so you may run into a few issues.
I'm not sure why you'd even consider doing this as this sounds like an operation nightmare! For science!

How to enable networking service at boot in Yocto

I have a Yocto based OS on which I have everything installed to start the network.
Nevertheless, at each boot I need to do systemctl start networking to start it. Initially the service was even masked. I found out how to unmask it but I can't find a way to start it automatically.
I don't know much about systemd but the networking.service is located in generator.late folder. From what I understood, it's generated afterward.
How can I enable it?
It depends if you want to enable the service only on one particular device. If yes, it is simple:
systemctl enable networking
Append the parameter --now if you also want to start the service just now.
If you want to enable the service on all your devices (i.e. it will be automatically enabled in all your images coming from build), the best way is to extend the recipe, but please see below for other ways how to handle the network. The process is describe at NXP support for example.
Some notes about networking.service itself: I assume that your networking.service comes from init-ifupdown recipe. If yes, is there any reason to handle network configuration using old SysV init script in system with systemd? The service is generated from SysV init script by systemd-sysv-generator. So I would suggest to try other networking services like systemd's native "systemd-networkd", "NetworkManager" or "connman". The best choice depends on type of your embedded systemd. These services are integrated with systemd much better.
Some more information on activating or enabling the services: https://unix.stackexchange.com/questions/302261/systemd-unit-activate-vs-enable

What's a good strategy to restart downed FastCGI processes automatically?

I've got a Perl based FastCGI app that rarely goes down. However, when it does go down, the restart is not automatic. Restarting Apache manually always does the trick but that does address improving the uptime of the app.
I'm thinking of using a cron job in conjunction with a script that uses WWW::Mechanize to periodically check on the app and restart it as required, as suggested by the folks at Perl Monks :
Keep FastCGI Processes Up and Running
Before I do that, I'm want to know if anyone knows of better ways to monitor a FastCGI process and restarting it automatically when it dies, or is the method suggested above the optimal one?
Thanks.
Monit is a nice monitoring daemon that can do automatic restarts and/or notification.
How about not having the process supervised by Apache but using an mechanism similar to the way init(8) starts getty processes? I have found daemon to be quite useful.
Most of the web servers offer already offer this as a configuration option.