New answers tagged

1

You can list the files being used by systemd for the socket by using: $ systemctl cat httpd.socket and on my system this shows (some lines removed to keep it short): # /usr/lib/systemd/system/httpd.socket [Unit] Description=Apache httpd Server Socket [Socket] ListenStream=80 [Install] WantedBy=sockets.target # /usr/lib/systemd/system/httpd.socket.d/10-...


0

I have come to the conclusion that capability CAP_NET_BIND_SERVICE specifically and capabilities in general cannot transcend user namespaces. From user_namespaces(7): User namespaces isolate security-related identifiers and attributes, in particular, user IDs and group IDs (see credentials(7)), the root directory, keys (see keyrings(7)), and ...


0

I also needed it, so I made it a shell script function. # Usage # sc start nginx # sc start nginx php74-php-fpm function sc { name="${@:(2)}"; echo "COMMAND: ${1}, NAME: ${name}"; systemctl "${1}" ${name}; systemctl status ${name}; } Reduces the command entry process as follows. #systemctl start nginx; systemctl ...


2

Do not use tmpfs for persistent storage. If this copy script does not run, such as when the host crashes, it is gone. Use persistent disk volumes. Perhaps not backed up and less redundant than important data, but durable. Linux already uses available RAM for caching. So those recently accessed files are in RAM when you check for software updates again, or ...


0

I was not able to make it work with the --user and other such options. However, I can see the data when I use journalctl on its own. It includes all the logs, though. I can search the specific app I'm interested in and look at that output. To find the latest, I first go at the end of the file then search backward: Hit G to go to the end (it's a capital G) ...


0

So even though "Amazon Linux 2" should have this command by default, the docker image for it – amazonlinux:2 – does not. To install it there use this directive: FROM amazonlinux:2 RUN yum install -y /usr/bin/systemctl


0

Huh. So similarly to the other question I mentioned, it was a completely different application. A Tomcat 8.5 which is running on same server, I restarted it on both servers for a different reason, and cron jobs are running again... I'm stumped. Although I notice there is a bit more memory available: Server01: top - 14:23:35 up 39 days, 2:02, 2 users, load ...


0

Create drop-ins for the unit definitions of the services you want to start after your script. drop-ins are files that override directives in the original unit definition. They belong into directories with the schema /etc/systemd/system/<servicename>.service.d. For a concrete example, let's use apache. First you need to find out the current After= line ...


0

You could configure some variables if you say the playbook is generic, a short example: Hosts file: [t1] host1 [t2] host2 [t1:vars] service=chronyd [t2:vars] service=ntpd [t:children] t1 t2 You run it against - hosts: t , at the end of the play: - name: start specific service: name: "{{ service }}" state: started


0

On Ubuntu I needed to increase the TasksMax for a single user, the CI service user (UID 2000) that runs all of my group's tests, from the default limit of 10813 to something higher. I checked the old limit with sudo systemctl status user-2000.slice, then set a new limit by typing sudo systemctl edit --force user-2000.slice and entering: [Slice] TasksMax=...


2

It seems to me that it would be easier to start those services at the end of the Ansible playbook rather than trying to implement that in systemd. I would just add: - name: start service service: name: service_name state: started to the end of the playbook. Ansible fails fast so that when that task is at the end of the play the completion of the ...


1

I found ! When installing services I did : systemctl enable /my/path/truc@.service This leads to a symbolic link into: /etc/systemd/system/machin.target.wants/truc@.service This seems to be the mistake. If I remove that symlink, after doing a 'daemon-reload', the list-dependencies tells: machin.target --bidule.service --truc@001.service --truc@002.service


1

Since the question mentions Arch Linux (systemd-controlled from day one) and logging, I'll hazard a guess it is related to logging from a systemd service. Here's another logging technique for shell scripts invoked from systemd service units. systemd can be (and by default is) set up to listen to the service's processes stderr and/or stdout, and forward ...


2

you can do this by editing /etc/syslog.conf like this: *.=info;*.=notice;*.=warning;\ auth,authpriv.none;\ cron,daemon.none;\ mail,news.none -/var/log/messages you can change =warning to =notice =info etc according to the logging level you want


1

SyslogIdentifier= and test-0 are not a facility but a program name. Replace %syslogfacility-text% by %programname% and use a legacy property filter selector like :programname, startswith, "test-" ?TestFile


1

The following unit definition is working for me: [Unit] Description=SVN server After=network.target [Service] User=svn Group=svn Type=forking ExecStart=/usr/bin/svnserve -d --listen-port=9999 -r /var/svn [Install] WantedBy=multi-user.target Note that I set Type=forking because svnserve daemonizes itself with -d. Side note: Your own service definitions ...


Top 50 recent answers are included