You are not logged in.

#1 2012-10-28 20:45:52

wprater
Member
Registered: 2012-10-28
Posts: 6

Setting new hostname: failed to issue method call

Trying to set the new hostname with the `hostnamectl` util provides the following error.  Ideas?

# hostnamectl set-hostname my-new-hostname                                                                       
Failed to issue method call: The name org.freedesktop.PolicyKit1 was not provided by any .service files

# systemctl --version
systemd 195
arch
+PAM -LIBWRAP -AUDIT -SELINUX -IMA -SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ

Last edited by wprater (2012-10-28 22:46:54)

Offline

#2 2012-10-28 22:45:44

ravster
Member
From: Queen's U, Kingston, Canada
Registered: 2004-05-02
Posts: 285
Website

Re: Setting new hostname: failed to issue method call

I'm getting a similar error

Failed to issue method call: Launch helper exited with unknown return code 1

I'm using the systemd-195-2 package.

Offline

#3 2012-10-28 22:58:30

opensrcrox
Member
Registered: 2012-08-10
Posts: 32

Re: Setting new hostname: failed to issue method call

Do you have the latest polkit installed?

 /usr/share/dbus-1/system-services/org.freedesktop.PolicyKit1.service is owned by polkit 0.107-4 

Offline

#4 2012-10-29 08:57:28

wprater
Member
Registered: 2012-10-28
Posts: 6

Re: Setting new hostname: failed to issue method call

I've upgrade the polkit package and now see this


# hostnamectl set-hostname example
Failed to issue method call: Access denied

Last edited by wprater (2012-10-29 08:57:42)

Offline

#5 2012-10-30 11:57:41

padremayi
Member
Registered: 2012-06-29
Posts: 49

Re: Setting new hostname: failed to issue method call

Try this, for me it worked:

echo myhostname > /etc/hostname

From: Beginners Guide - Hostname

NOTE: /etc/hostname must be owned by root:root and must have permissions set to 644

Last edited by padremayi (2012-10-30 12:03:06)

Offline

#6 2012-11-04 20:52:20

zarac
Member
Registered: 2010-06-23
Posts: 2

Re: Setting new hostname: failed to issue method call

I had the same issue. Resolved by installing polkit (and rebooting).

[root@localhost zarac]# hostnamectl set-hostname stan
Failed to issue method call: The name org.freedesktop.PolicyKit1 was not provided by any .service files
[root@localhost zarac]# localectl set-locale LANG="en_US.utf8"
Failed to issue method call: The name org.freedesktop.PolicyKit1 was not provided by any .service files

Offline

#7 2012-11-04 21:07:50

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,109
Website

Re: Setting new hostname: failed to issue method call

You need to actually boot with systemd for the *ctl tools to work.

Offline

#8 2012-11-19 23:37:14

netawater
Member
Registered: 2008-08-01
Posts: 36

Re: Setting new hostname: failed to issue method call

falconindy wrote:

You need to actually boot with systemd for the *ctl tools to work.

yes, append the following to your kernel line: init=/usr/lib/systemd/systemd

Offline

#9 2012-11-21 14:35:09

nkuflk
Member
Registered: 2012-11-21
Posts: 1

Re: Setting new hostname: failed to issue method call

netawater wrote:
falconindy wrote:

You need to actually boot with systemd for the *ctl tools to work.

yes, append the following to your kernel line: init=/usr/lib/systemd/systemd


how to append the command to kernel??

Offline

#10 2012-11-21 14:57:03

bslackr
Member
Registered: 2012-01-27
Posts: 131

Re: Setting new hostname: failed to issue method call

nkuflk wrote:
netawater wrote:
falconindy wrote:

You need to actually boot with systemd for the *ctl tools to work.

yes, append the following to your kernel line: init=/usr/lib/systemd/systemd


how to append the command to kernel??

This depends on your bootloader. Are you using grub?

Offline

#11 2013-01-10 17:33:28

TDKVerbatim
Member
From: South Africa
Registered: 2012-02-12
Posts: 4

Re: Setting new hostname: failed to issue method call

padremayi wrote:

Try this, for me it worked:

echo myhostname > /etc/hostname

I had the same issue (had already migrated to systemd) this worked for me


"With every breath that I am given I will sing Salvation's song" - Stuart Townend

Offline

#12 2018-03-28 11:43:51

chibby0ne
Member
Registered: 2016-12-02
Posts: 1

Re: Setting new hostname: failed to issue method call

Even though the approaches mentioned before work well, I wanted to leave this here in case someone ends up in this thread and wants to use the systemd approach.

I was having a similar issue in a Debian Jessie installation in a Raspberry Pi.

$ hostnamectl set-hostname slowraspberry
Could not set property: The name org.freedesktop.PolicyKit1 was not provided by any .service files

I installed policykit-1 (in Arch that's polkit), and then I would get:

$ hostnamectl set-hostname slowraspberry
Could not set property: Access denied

Simply adding sudo did the trick. Afterwards, I would get an annoying warning everytime I used sudo.

sudo: unable to resolve host slowraspberry

Just needed to reboot to make to propagate the change in all the right places.

Additionally, I needed to update //etc/hosts entries with new hostname, so that the local addresses can resolve with the new hostname.

Last edited by chibby0ne (2018-03-28 11:51:16)

Offline

#13 2018-03-28 12:08:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 4,377

Re: Setting new hostname: failed to issue method call

Thanks for sharing, however most of these would not have the same relevance on an up to date Arch system and the original issue arose during the transition phase to systemd.

Please don't necrobump in the future.

https://wiki.archlinux.org/index.php/Co … bumping.22

Closing.

Online

Board footer

Powered by FluxBB