I try to start multiple processes with systemd - restart if it terminated included. The only difference is the argument of the processes.
Is there a way to avoid a unit-file per process??
I am looking for a unit-file for all processes together.
Normally I would use a start-skript but - as I said - restart in case of termination should be also included. And I do not see a way to do it with pure systemd and no handmade skriptlets.
Thanks!
Perhaps using a template unit fits your needs. From systemd.unit(5)
Optionally, units may be instantiated from a template file at runtime. This allows creation of multiple units from a single configuration file. If systemd looks for a unit configuration file, it will first search for the literal unit name in the file system. If that yields no success and the unit name contains an "#" character, systemd will look for a unit template that shares the same name but with the instance string (i.e. the part between the "#" character and the suffix) removed. Example: if a service getty#tty3.service is requested and no file by that name is found, systemd will look for getty#.service and instantiate a service from that configuration file if it is found.
To refer to the instance string from within the configuration file you may use the special "%i" specifier in many of the configuration options. See below for details.
So you might create a file myservice#.service that reads something like
[Unit]
Description=MyService component %i
PartOf=myservice.target
[Service]
Type=simple
ExecStart=/usr/local/bin/myservice %i
Restart=on-failure
and the master unit myservice.target as
[Unit]
Description=Myservice
Requires=myservice#a.service myservice#b.service myservice#c.service
The PartOf= specification in myservice#.service ensures that when the target is stopped or restarted each component is as well. With Requires= in myservice.target each component must be started for myservice to have successfully started. I think it should be the case that if any individual component fails any that didn't fail should be terminated; i.e. its all or nothing. If that's not what you want you might use Want= instead of Requires=.
It's a little awkward, but if you need to supply multiple arguments you can introduce an indirection through environment variables. For the template unit add Environment=args=%i and replace %i in the ExecStart with $args. I think it'd be better to find an alternative to that, but without knowing more about your use-case I'm not sure what that solution would be.
How can I change the .eclipse folder in Linux? I tried adding this line:
-Dosgi.configuration.area=/directory/directory1/eclipse/.eclipse
at the top of eclipse.ini but it doesn't work. I've also tried adding it to various other places in the eclipse.ini but still no luck.
Edit
I have added this line:
-Dosgi.configuration.area=file:/directory/directory1/eclipse/.eclipse
immediately below -vmargs. When Eclipse starts, it now reads from the correct .eclipse location and if .eclipse does not exist there, it creates it. Unfortunately, after Eclipse has loaded, another .eclipse folder is created in my home folder and Eclipse then continues to read from that folder. I suspect that my eclipse.ini file is now correct but there is another file I need to change.
The simplest thing to do is probably pass java a different user.home so that all the other myriad of places that derive a location base it off of user.home. So instead of what you have, use this in .ini file:
-Duser.home=/directory/other/here
In addition to .eclipse, you will probably find other directories created in your overridden user.home, such as .p2, .oracle_jre_usage, etc.
Other notes:
-Dosgi.configuration.area is the changes the configuration area for Eclipse, it does not effect user area. You also probably don't want to change that setting away from the default unless you really want multiple configurations (read more below).
Additionally, the normal thing to do would be to use -configuration as an argument to eclipse{.exe} and let eclipse convert it to the appropriate VM argument.
You probably want -user though to override the user area. Have a look at locations in the Eclipse help for more info (quoted below).
However, there are still things that have individual control over their location, such as secure storage, which is controlled by the -eclipse.keyring command line argument.
Locations
The Eclipse runtime defines a number of locations which give
plug-in developers context for reading/storing data and Eclipse users
a control over the scope of data sharing and visibility. Eclipse
defines the following notions of location:
User (-user) {osgi.user.area} [#none, #noDefault, #user.home,
#user.dir, filepath, url]
User locations are specific to, go figure,
users. Typically the user location is based on the value of the Java
user.home system property but this can be overridden. Information such
as user scoped preferences and login information may be found in the
user location.
Install (-install) {osgi.install.area} [#user.home,
#user.dir, filepath, url]
An install location is where Eclipse itself
is installed. In practice this location is the directory (typically
"eclipse") which is the parent of the eclipse.exe being run or the
plugins directory containing the org.eclipse.equinox.launcher bundle.
This location should be considered read-only to normal users as an
install may be shared by many users. It is possible to set the install
location and decouple eclipse.exe from the rest of Eclipse.
Configuration (-configuration) {osgi.configuration.area} [#none,
#noDefault, #user.home, #user.dir, filepath, url]
Configuration
locations contain files which identify and manage the (sub)set of an
install to run. As such, there may be many configurations per install.
Installs may come with a default configuration area but typical
startup scenarios involve the runtime attempting to find a more
writable configuration location.
Instance (-data) {osgi.instance.area}
[#none, #noDefault, #user.home, #user.dir, filepath, url]
Instance
locations contain user-defined data artifacts. For example, the
Resources plug-in uses the instance area as the workspace location and
thus the default home for projects. Other plugins are free to write
whatever files they like in this location.
While users can set any of
these locations, Eclipse will compute reasonable defaults if values
are not given. The most common usecase for setting location is the
instance area or, in the IDE context, the workspace. To run the
default Eclipse configuration on a specific data set you can specify:
eclipse -data c:\mydata
You must put property definitions like this at the end of the eclipse.ini after the -vmargs line. If there is no -vmargs line you must add one.
So:
.... other lines ....
-vmargs
... other arguments
-Dosgi.configuration.area=/directory/directory1/eclipse.eclipse
With MSTest.exe, you can specify a total timeout for a test run by setting the /TestSettings/Execution/Timeouts/#runTimeout attribute in a .testsettings file.
With VSTest.Console.exe, the .testsettings has been deprecated in favor of .runsettings, which apparently has a completely different schema (with, ahem, sparse documentation). I know that I can configure the .runsettings file to use legacy MSTest mode (thereby allowing me to use a .testsettings file), but I would prefer to avoid that if possible.
Is there a way to set a run timeout in the .runsettings file? Or is there a different way to get the same effect?
Yes, there is. Please see RFC here: 0011-Test-Session-Timeout.md
Context
I'm building my complete debian system configuration,
so I'm modifying the keyboard and console setups.
I prefer not to modify the base files to keep a maximum
commpatibility and modularity. So I want to use VARIANT
(see setupcon (5)) and load them at init.
But not sure I'm doing it right.
Desired Architecture
I will only use keyboard file for the following example.
There is the base file /etc/default/keyboard
And two possible custom files (according to setupcon (5))
~/.keyboard
/etc/default/keyboard.variant
~/.keyboard
It provides a custom behaviour per $HOME (user)
/etc/default/keyboard.variant
A global and default keyboard setup
I would like to use the three at a time.
Problem
The daemon calling setupcon are console-setup and console-setup-mini
(according to the coments in their initd scripts). They are started
before login shell, so won't know ~/.keyboard.
setupcon needs to be called
setupcon variant
or, looking at the sources, with a variable $VARIANT
VARIANT=variant
What is the best solution to adopt, saving a maximum modularity.
Thank you,
The issue I'm having is that every time I alter a busybox configuration setting (using menuconfig), I get asked the same question during the build:
udhcp Client with zeroconf support (CONFIG_UDHCPC_ZEROCONF) [N/y/?] (NEW)
If I update the default vendor settings, the values in busybox's .config file get written to my vendor file. For example if I change CONFIG_UDHCPC=y, my vendor config file (vendors/MyCo/MyProd/config.vendor-x.x.x) will be updated with CONFIG_USER_BUSYBOX_UDHCPC=y.
This doesn't happen for the CONFIG_UDHCPC_ZEROCONF option. I tried manually adding CONFIG_USER_BUSYBOX_UDHCPC_ZEROCONF=y to my vendor config file, but still get asked the question.
So my question is: How are other options transferring between the .config and the config.vendor file, but that one in particular is not? I don't know enough about the configuration build system to find the answer.