what does this mean in command systemctl status - service

When I use command systemctl status to list all service in linux, I got this:
enter image description here
why is there underline under docker.service and containers.service?
why is there three dots behind docker.service and containerd.service?
I am looking for why eBPF uprobe cannot work when I attach an uprobe to daemon /usr/bin/dockerd and /usr/bin/containerd, while it works well on other daemons.
Everytime I try to attach an uprobe to this two daemon by bpftrace, it tells me "ERROR: uprobe target file '/usr/bin/dockerd' does not exist or is not executable".

Related

How to configure telnet service for yocto image

telnet is necessary in order to maintain compatibility with older software in this case. I'm working with the Yocto Rocko 2.4.2 distribution. when I try to telnet to the board I'm getting the oh so detailed message "connection refused".
Using the method here and the options here I modified the busybox configuration per suggestion. When the board is booted up and logged in, if you execute: telnet, it spits out usage info and a quick directory check shows that telnet is installed to /usr/bin/telnet. My guess is that the telnet client is installed but the telnet server is not running?
I need to get telnetd to start manually at least so I know it will work with an init script in place. The second reference link there suggests that 'telnetd will not be started automatically though...' and that there will need to be an init script. How can I start telnetd manually for testing?
systemctl enable telnetd
returns: Unit telnetd.service could not be found
UPDATE
telnetd in located in /usr/sbin/telnetd. I was able to manually start the telnetd service for testing from there. After manually starting the service telnet login now works. looking into writing a systemd init script to auto start the telnetd service, so I suppose this issue is closed. unless anyone would like to offer up detailed telnet busybox configuration and setup steps as an answer to 'How to configure telnet service for yocto image'
update
Perhaps there is something more? I created a unit file that looks like this:
[Unit]
Description=auto start telnetd
[Service]
ExecStart=/usr/sbin/telnetd
[Install]
WantedBy=multi-user.target
on reboot, systemd indicates the process executed and succeeded:
systemctl status telnetd
.
.
.
Process: 466 ExecStart=/usr/sbin/telnetd (code=exited, status=0/SUCCESS)
.
.
.
The service is not running however. netstat -l does not list it and telnet login fails. Something I'm missing?
last update...i think
so following this post, I managed to get telnet.socket service to startup on reboot.
systemctl status telnet.socket
shows that it is running and listening on 23. Now however, when I try to remote in with telnet I'm getting
Connection closed by foreign host
Everything I've read so far has been talking about xinetd service (which I do not have...). What is confusing is that, if I just navigate to /usr/sbin/ and execute telnetd, the server is up and running and I can telnet into the board, so I do not believe I'm missing any utilities or services (like the above mentioned xinetd), but something is still not being configured correctly. any ideas?

Cant enable service with systemctl

I made this service:
#!/bin/bash
node ../../home/NodeServer/server.js
All it should do is start the server on bootup, so i wanted to do
sudo systemctl enable startServer.service
But I got this error:
startServer.sh.service is not a native service, redirecting to systemd-sysv-insall.
Executing: /lib/systemd/systemd-sysv-install enable startServer.sh
update-rc.d: error: startServer.sh Default-Start contains no runlevels, aborting.
When i try to do
sudo systemctl start startServer.service
it works like intended.
I had the same problem. I solve it typing again the file because it seems that there was a strange character that was broken the parser. Hope this helps!
You want to execute a script, which is not the same as a service.
You can make a file called startServer.service and write the following into it:
[Unit]
Description=Start server that does a thing
[Service]
ExecStart=node /home/NodeServer/server.js
If you want to enable the service, do the following:
sudo ln -s /home/NodeServer/startServer.service /etc/systemd/system/
and now you should be able to start the service.

systemctl from inside docker container fails with D-Bus connection error

I have setup a docker container based on OpenSuse 12, installed some additional files and copied some installer binaries into the container. So far everything fine.
From inside a running image of the container I now need to run the aforementioned setup program but this needs to have uuid.socket up and running - uuid.socket in turn needs systemctl to work correctly and this causes an error like this:
hxehost:/usr/sap/SRCFiles # systemctl
Failed to get D-Bus connection: Unknown error -1
I started the docker container like this:
docker run -h hxehost -i -t f3096b0aa964 /bin/bash
Which, according to some postings should start a machine container as opposed to an application container.
Can anyone tell me what I'm doing wrong here??? How do I get systemctl to work inside a docker container?
I tried to starte the container with this command, which according to linked hints should do, but to no avail
docker run --privileged --rm -ti -e 'container=docker' -h hxehost --network="bridge" --tmpfs /run --tmpfs /tmp -v /sys/fs/cgroup:/sys/fs/cgroup:ro siliconchris/hxe:v0.0.2 /bin/bash
If I do this, systemctl still gives exact same error.
If I start /sbin/init instead of /bin/bash, I can see that quite a lot of services are started (some, like wicked, login and module, fail). In the end, the container presents me with a login. After login, I can now execute systemctl and it shows all services with their respective states.
Now my next question is: IS THIS APPROACH FEASIBLE AT ALL???
Best regards,
Chris
You may find the repo to this image at SAP HANA Express Edition inside docker
Most current Linux systems depend on SystemD running, and systemctl will send requests to it. However most applications did install easily when I replaced the systemctl binary with a script that just interprets start/stop/status/enable commands. As another benefit, it would not need anymore those complicated startup-commands for the resulting image to get the systemd mapped into the container. May be that would help you? Please have a look at the docker-systemctl-replacement.

How to set target (runlevel) to service in CentOS7 (Systemd)?

I want to set target to service in CentOS7 (Systemd).
I want to know following.
How to set target to service.
How to show target of service.
In other words, I want to know substitution for following commands.
$ sudo chkconfig --level=2345 mysql on (<- set runlevel)
$ chkconfig --list mysql (<- show runlevel)
I understood that "runlevel" in CentOS6 changed "target" in CentOS7and I should use "systemctl" command.
But problems were not solved.
I heard that following command is replacement for "chkconfig --list"
, but I can't check target and can't set target.
systemctl list-unit-files
Setting the target is done in the unit file for the service. For example:
[Install]
WantedBy=multi-user.target
Then you run systemctl enable $service_name to create a symlink which enables the service to start as part of a particular target. You could also create the symlinks manually. The enable command will print out the paths of the symlinks it's creating.
I think systemctl --reverse list-dependencies $service is the way to find what services and targets depend on a specific services to boot.

Centos Service not starting

Running Centos7, I have init.d service that I'm trying to start. When I do so it comes back with an OK message which = success. Yet when I use TOP I don't see it running.
Now if I take the command that the service should be running from the cat /etc/init.d/XXXX it starts as expected.
How can I go about debugging this? I've checked /messages, and /secure and even dmesg but I don't see anything amiss.
Try systemctl start <command>
Eg if you want to start ssh
systemctl start sshd
or
systemctl start sshd.service
Look for man pages of systemctl
Explaination
CentOS 7 / RHEL 7 / Fedora Linux (many other modern distor) uses Systemd. It is a system and service manager for Linux operating systems. In newer distro such as CentOS7/RHEL7 systemd replaces Upstart as the default init system
In case you have scripts for starting & stopping of a particular process or code
you can place a file /etc/init.d/ directory
with somewhat below logic
#!/bin/bash
SCRIPT_PATH=/pathtoscriptdirectory
case $1 in
start)
sh $SCRIPT_PATH/startup.sh
;;
stop)
sh $SCRIPT_PATH/shutdown.sh
;;
restart)
sh $SCRIPT_PATH/shutdown.sh
sh $SCRIPT_PATH/startup.sh
;;
esac
exit 0
Its good practice to make start stop restart blocks, you can have your custom blocks too
Also make sure that you have executable permission over all the files in this lineup
Then run it like you run the normal services