Timedatectl on a new Ubuntu box

Hello,

I got an issue when running ansible-playbook -i hosts/production server.yml on a fresh Ubuntu 14.04 LTS 64-bit. This doesn’t seem to be Trellis related at all but a problem with the box but I’m wondering if someone else have had similar issues?

TASK: [common | Set timezone] *************************************************
failed: [79.99.2.67] => {"cmd": "timedatectl set-timezone Etc/UTC", "failed": true, "rc": 2}
msg: [Errno 2] No such file or directory

Running timedatectl on the server gives -bash: timedatectl: command not found

timedatectl should be default on the server right? I wasn’t able to find any info on why this command isn’t available and was hoping someone here would have a clue.

Where is the Ubuntu OS from? timedatectl appears to be standard so I don’t know how it could be missing.

It’s even mentioned in a book! https://books.google.ca/books?id=399WCAAAQBAJ&pg=PT126&lpg=PT126&dq=ubuntu+timedatectl&source=bl&ots=XN-PgRtLBv&sig=CnsG1p6PxEt1vISnyN1KdPF2pVA&hl=en&sa=X&ved=0CBwQ6AEwADgKahUKEwid-YKnnOrHAhVGbj4KHaq1DPM#v=onepage&q=ubuntu%20timedatectl&f=false

http://manpages.ubuntu.com/manpages/trusty/man1/timedatectl.1.html

Maybe you’re missing the systemd-services package?

1 Like

It’s a standard box from a known Swedish VPS company… maybe something went wrong with their provisioning service…

Yes, googling around it seemed to me that it should be standard. Didn’t find anyone having problems with it…

How do I install systemd-services ? Is it complicated? Being a bit of a server config noob…

Just sudo apt-get install systemd-services.

But you should do this through Ansible. I’d just add that package to this list: https://github.com/roots/trellis/blob/6c8d8919dc2c71642f3827945e9a326f464c315d/roles/common/tasks/main.yml#L20

edit: and then re-provision of course

2 Likes

Thanks a lot! Now it’s working :smile: