The function
get_fullhostname(server_host, server_host, PBS_MAXHOSTNAME, EMsg)
Does the equivalent of hostname -f
I solved it by adding the ip address of the vm to the /etc/hosts file
10.2.191.12 cent63
Domanda
When I attempt to run "torque.setup" on a vm created in open stack, I get the error "unable to determine local server hostname"
Installing torque on a VM created in any other hypervisor gives no error, and works correctly.
[root@cent63 github]# /var/spool/torque/github/torque.setup root
initializing TORQUE (admin: root@cent63)
PBS_Server: LOG_ERROR::pbsd_main, unable to determine local server hostname - getaddrinfo(cent63) failed, h_errno=1
ERROR: pbs_server failed to start, check syslog and server logs for more information
cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@cent63 github]# hostname
cent63
[root@cent63 github]# service iptables status
iptables: Firewall is not running.
The hostname is set, so what is torque complaining about?
vim src/server/pbsd_main.c
snprintf(server_host, PBS_MAXHOSTNAME, "%s", optarg);
if (get_fullhostname(server_host, server_host, PBS_MAXHOSTNAME, EMsg) == -1)
{
/* FAILURE */
if (EMsg[0] != '\0')
{
char tmpLine[1024];
snprintf(tmpLine, sizeof(tmpLine),
"unable to determine full hostname for specified server host '%s' - %s",
server_host, EMsg);
log_err(-1, __func__, tmpLine);
}
else
{
log_err(-1, __func__, "unable to determine full server hostname");
}
exit(1);
}
UPDATE: It looks like I do not have a fully qualified host name.
[root@cent63 github]# hostname -f
hostname: Unknown host
So far, adding a hostname to /etc/hosts has not solved the issue.
Soluzione
The function
get_fullhostname(server_host, server_host, PBS_MAXHOSTNAME, EMsg)
Does the equivalent of hostname -f
I solved it by adding the ip address of the vm to the /etc/hosts file
10.2.191.12 cent63