Hot answers tagged

4

You can set MACAddressPolicy to random in your network device configuration file aka the systemd.link file e.g. /etc/systemd/network/40-wlan-mac.link: [Match] Driver=iwlwifi Type=wlan [Link] Name=wl0 MACAddressPolicy=random If you have no custom .link files, the default MACAddressPolicy is specified in the upstream .link file in /usr/lib/systemd/network/...


4

2016 Update Most answers here are five years old so it's time for some updates. Ubuntu used to use upstart by default but they abandoned it last year in favor of systemd - see: Grab your pitchforks: Ubuntu to switch to systemd on Monday (The Register) Because of that there is a nice article Systemd for Upstart Users on Ubuntu wiki - very detailed ...


3

Ah, this turned out to be much easier than I thought it would be. Found an answer here: http://unix.stackexchange.com/a/229525/11995! SyslogIdentifer=foo


3

Yes, this is by design. The man page for systemctl disable says: Disables one or more units. This removes all symlinks to the specified unit files from the unit configuration directory, and hence undoes the changes made by enable. Note however that this removes all symlinks to the unit files (i.e. including manual additions), not just those actually ...


3

I don't have tomcat, but it should be the same as for apache, which I tried as follows (you probably only need to replace httpd by tomcat everywhere). Simply create an new systemd httpd.service file in /etc which includes and overrides part of the one in /lib. For example, create /etc/systemd/system/httpd.service to contain .include /lib/systemd/system/...


3

You're right to be surprised: that order doesn't make sense. If a book presents it that way, it's sloppy and misleading. Unmounting a filesystem, or mounting it read-only, writes all the data to the disk. When the umount command or mount -o remount,ro returns, all the data is written to the disk and sync has nothing left to do. It's pointless to call sync ...


2

Remounting an fs read only prevents any file-level write requests and open() calls with rw mode from processes, thus no further data and fs structure modification is possible. The buffering is laying between block device drivers and fs drivers, so if the system has any dirty buffers it should write them to the underlying media. The typical stack looks this ...


2

Ooopps, gunicorn runs as: $ gunicorn [OPTIONS] APP_MODULE And you did $ gunicorn APP_MODULE [OPTIONS] The last part of your gunicorn_start.sh script shall be: exec /html/public_html/yogavidya/venv/bin/gunicorn \ --name $NAME \ --workers $NUM_WORKERS \ --user $USER \ --bind=unix:$SOCKFILE \ ${DJANGO_WSGI_MODULE}:application On a ...


2

From section DECLARING ACTIONS of polkit - Authorization Framework: defaults This element is used to specify implicit authorizations for clients. Elements that can be used inside defaults includes: allow_any Implicit authorizations that apply to any client. Optional. allow_inactive Implicit ...


2

I recommend switching to a systemd based Linux distro, like Fedora or Ubuntu 16.04. systemd can easily pass environment variables to your process AND it can handle automatically restarting your process it fails as well as starting it at boot. Logging is also nicely handled by systemd`s journald. There's also not the overhead of installing or running ...


2

It's the priority that determines how journalctl displays messages. Based on a quick test with logger : Messages of priority debug and info are displayed "normally". Messages of priority notice and warning are displayed in bold white. Messages of priority err, crit, alert, emerg are displayed in bold red. Edit: To answer the comment about how to ...


2

Yes, there is. You can specify to retry after x seconds under [Service] section, [Service] Type=simple Restart=always RestartSec=3 ExecStart=/path/to/script After saving the file you need to reload the daemon configurations to ensure systemd is aware of the new file, systemctl daemon-reload then restart the service to enable changes, systemctl ...


2

@mark-stosberg, this is a known issue: journald is unable to attribute messages incoming from processes that exited to their cgroup, due to /proc vs SCM_CREDS race You can find a workaround there: https://github.com/systemd/systemd/issues/2913#issuecomment-219702148 try SyslogIdentifier= Sets the process name to prefix log lines sent to the ...


2

systemd has a number of monitor types which handles basic stuff. A common one is "is the process started by systemd still running". This, along with configuration data, log lines, etc are the sort of information reported by systemctl $ systemctl status httpd * httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service;...


2

In do_mounts.c, the variable saved_root_name is set to the value of the root= command line parameter, if present. This value is a path-like string passed by the kernel, it typically looks like /dev/something (though the /dev/ prefix is optional) but it doesn't actually correspond to any on-disk path. If the root= parameter is absent, the value of ROOT_DEV is ...


2

May be you shoul try to add first start after boot, like this: [Timer] OnBootSec=15min OnUnitActiveSec=2m


1

First you can confirm that you already have the mpm_prefork module by seeing that's shipped in the apache2 package in 16.04. You'll see a couple results for it if you do this: dpkg -L apache2 | grep fork /etc/apache2/mods-available/mpm_prefork.conf /etc/apache2/mods-available/mpm_prefork.load Now check which MPM module is enabled, and you'lll see that ...


1

I researched this, and it appears to be a known issue with systemd that there is a pull request for. The fix involves caching the metadata for the service, so that even if the service has exited, the metadata for it is still available to properly categorize the last few logs. It's also considered an open bug in CoreOS, which uses systemd. The bug is also ...


1

This link contains the information given by the other answer in a better way. Especially this part: The defaults tag is where the permissions or lack thereof are located. It contains three settings: allow_any, allow_inactive, and allow_active. Inactive sessions are generally remote sessions (SSH, VNC, etc.) whereas active sessions are logged ...


1

systemd gives up trying to restart it No. systemd gives up trying to restart it for a little while. This is clearly shown in the log that you supply:Jun 14 11:25:51 localhost systemd[1]: test.service: Failed with result 'start-limit'. This is rate limiting kicking in. The length of the little while is specified in the service unit, using the ...


1

In addition to using Environment directive in the systemd service itself as suggested in this answer, another option is the EnvironmentFile directive. Please note that I am no expert in this area (obviously, I am the author of this question); I am only summarizing to the best of my ability the Fedora Wiki. Feel free to edit/correct me. EnvironmentFile ...


1

I'm not sure the distro you're using, but I'll approach from RHEL 7 (because that's what I'm using, and it should be similar). systemd normally looks for service files in /usr/lib/systemd/system/*.service (you can look at other service links to get an idea on your distro) To enable a service it should have an [install] section, and inside that install ...


1

So i got it all working [Unit] Description=HW1SVC After=network.target [Service] Type=simple User=servers2 WorkingDirectory=/data/steamcmd/hw6/ ExecStart=/data/steamcmd/hw6/Hurtworld.x86_64 -batchmode -nographics -exec "autoexec.cfg" -logfile "gamelog.txt" KillSignal=SIGINT TimeoutStopSec=30 Restart=always [Install] WantedBy=network.target this is the ...


1

According to man journalctl journalctl reads in journal files as created by systemd-journalctl.service. According to man systemd-journalctl.service the config file is located at /etc/systemd/journald.conf and it places journal files at /var/log/journal/[machine-id]/*.journal if it exists, otherwise it places them in /run/log/journal/[machine-id]/*.journal. ...


1

If you want to run a systemd unit from your udev, you can now just name the unit (see man systemd.device). For example, if you look in your (/usr)/lib/udev/rules.d/99-systemd.rules you should find an example like SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_WANTS}+="bluetooth.target" which has the 2 important points: you must add the TAG systemd, ...


1

Here is part of the code which does the shutdown (System V style implementation): /* * Kill all processes, call /etc/init.d/halt (if present) */ void fastdown() { int do_halt = (down_level[0] == '0'); int i; #if 0 char cmd[128]; char *script; /* * Currently, the halt script is either init.d/halt OR rc.d/rc.0, * likewise ...



Only top voted, non community-wiki answers of a minimum length are eligible