Linux Labs

First steps / Stage 9 of 15

Text and editors

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 8 · on a machine · 5 min

A port set twice

The config has two port lines, and the service takes the last one. Which commands leave a single line is up to you.

A grep match proves that a line exists. It says nothing about a second line just like it. A config can set the same value twice, and the program picks one by its own rules — often the last. So before editing, find every line with the setting, and afterwards read the whole file.

Exercise · do it

Leave a single port

In ~/text-lab/web.conf the port is set twice, and the service takes the last value. Make a single port=9090 line set the port; leave the comment and mode=training alone. Keep the original file as web.conf.bak.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Keep the original in web.conf.bak not done yet
  • Leave one port line, set to 9090 not done yet
Check yourself 1 question

You saved web.conf with a single port=9090 line. The service was started with the old file. Which conclusions hold?

Several options are correct.

  • Many programs read their config at startup: until the service restarts, it keeps the old value. The service itself shows which value it uses now.

  • The copy is a separate file, and editing the original does not change it. cat web.conf.bak shows the original lines.

Saving changes the file on disk, while a running service usually picks up the new port only after a restart.

Step goals

0 of 2
  • Keep the original in web.conf.bak — not done yet
  • Leave one port line, set to 9090 — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Keep the original in web.conf.bak — not done yet
  • Leave one port line, set to 9090 — not done yet
Loading…