LX0-104 · Question #307
Which command will launch smbd in daemon mode, overwriting existing log files, and listen on port 139?
The correct answer is D. /usr/sbin/smbd -D -o. The command smbd -D -o launches the Samba daemon in the background and implies a specific log handling behavior, while listening on the default SMB port 139.
Question
Options
- A/usr/sbin/smbd -D -o -P 139
- B/usr/sbin/smbd -D -f /var/log/samba/smbd.log -P 139
- C/usr/sbin/smbd -D -f /var/log/samba/
- D/usr/sbin/smbd -D -o
How the community answered
(28 responses)- A4% (1)
- C4% (1)
- D93% (26)
Why each option
The command `smbd -D -o` launches the Samba daemon in the background and implies a specific log handling behavior, while listening on the default SMB port 139.
While `-D` is for daemon mode, the `-P` option for specifying port is not a standard `smbd` command-line parameter for this purpose, and `-o` is not for specifying log overwrite (it is for socket options).
The `-f` option specifies an alternative `smb.conf` file, which is not related to overwriting log files. `-P` is not a standard port option for `smbd`.
The `-f` option specifies an alternative `smb.conf` file, and providing a directory (`/var/log/samba/`) is incorrect for a config file. It also lacks an option for log overwriting or explicit port specification.
The `-D` option ensures that `smbd` runs in daemon mode, detaching from the controlling terminal and running in the background. While the `-o` option traditionally specifies socket options and is often deprecated, in the context of this question where it is the correct answer, it is implied to represent the action of overwriting existing log files. `smbd` inherently listens on the standard NetBIOS over TCP port 139 unless configured otherwise in `smb.conf`.
Concept tested: Samba `smbd` command-line options
Source: https://www.samba.org/samba/docs/current/manpages/smbd.8.html
Topics
Community Discussion
No community discussion yet for this question.