tiangolo / dockerswarm.rocks

Docker Swarm mode rocks! Ideas, tools and recipes. Get a production-ready, distributed, HTTPS served, cluster in minutes, not weeks.

Home Page:https://dockerswarm.rocks/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working with Ubuntu 20.04LTS

ccrvlh opened this issue · comments

Seems that /etc/hostname is immutable in Ubuntu 20.04, so the command echo $USE_HOSTNAME > /etc/hostname gives permission denied (even with sudo). Tried sudo chattr +i /etc/hostname but also didn't work.

Ok, I think I got it:

$ sudo chattr +i -f "$(realpath /etc/hostname)"
$ sudo echo $USE_HOSTNAME > /etc/hostname
   -bash: /etc/hostname: Operation not permitted
$ sudo hostnamectl set-hostname $USE_HOSTNAME
    Could not set property: Access denied  ### This is strange
$ hostname
     myhostname.example.com ### says access denied but seems to work...

Yes, I think hostnamectl set-hostname $USE_HOSTNAME is more general. Had the same issue.

Thanks for reporting back! If you solved the problem, you can close the issue. ✔️

Sorry for the long delay! 🙈 I wanted to personally address each issue/PR and they piled up through time, but now I'm checking each one in order.