Bug 212074 - emulators/virtualbox-ose starting virtual machines with vboxheadless returns 'already running?'
Summary: emulators/virtualbox-ose starting virtual machines with vboxheadless returns ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Virtualbox Team (Nobody)
URL:
Keywords:
: 228111 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-08-23 11:05 UTC by Jan Jurkus
Modified: 2018-07-24 23:25 UTC (History)
7 users (show)

See Also:
bugzilla: maintainer-feedback? (vbox)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Jurkus 2016-08-23 11:05:38 UTC
When I start vboxheadless like this, it gives an error:

# service vboxheadless start vmname
vboxheadless already running?  (pid=738 756 770 784 798 812 826 840 854 868 882 896 910 924 938 952 966 980 994 1008 1022 1036 1050 1064 1078).

The listed pids are from the VBoxHeadless instances that are already running. These were started on boot, via rc.conf
In rc.conf they are listed like this:
vboxheadless_machines="vmname2 vmname3 vmname4 vmname-etc"

If I use /usr/bin/install and /usr/sbin/daemon to create a pid and to start VBoxHeadless the vm starts up like it should.

The virtual machine I am trying to start is not listed in vboxheadless_machines, and does not get started at boot. It works the same for other virtual machines that are not started on boot.
Comment 1 amvandemore 2016-09-23 12:59:04 UTC
Same here, haven't had time to check into this yet.

Issue occurred after upgrade from:

virtualbox-ose: 4.3.30 -> 4.3.38_1

System patch level also went from:

10.3-RELEASE-p3(I think) -> 10.3-RELEASE-p7
Comment 2 Pieter 2016-12-28 08:53:22 UTC
Seems to be since revision 292450 and/or revision 291770 of the freebsd base system. Noticed the same problem since I updated from 10.1 to 10.3 yesterday.

https://svnweb.freebsd.org/base/release/10.3.0/etc/rc.subr?view=log

+++++++++++++++++++++++
MFC r291770: rc.subr: Check for running daemons before a custom start_cmd
is executed.

Currently rc scripts implementing their own start_cmd do not enjoy the
benefits of rc.subr's own check for rc_pid.

This leads to around a third of ports with such a start_cmd not to check for
the process at all and two thirds of ports to re-implement this check
(sometimes wrongly).

---> This patch moves the check for rc_pid to before ${rc_arg}_cmd is executed.
+++++++++++++++++++++++

You can start vboxheadless using faststart after boot. When using fast the check for a 'pidfile' will be skipped. Dont know what checks will be skipped also.

Pieter
Comment 3 Walter Schwarzenfeld 2018-01-14 03:52:36 UTC
Maintainer feedback?
Comment 4 Bryan Drewery freebsd_committer freebsd_triage 2018-07-24 23:15:48 UTC
*** Bug 228111 has been marked as a duplicate of this bug. ***
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-07-24 23:22:42 UTC
A commit references this bug:

Author: bdrewery
Date: Tue Jul 24 23:22:28 UTC 2018
New revision: 475282
URL: https://svnweb.freebsd.org/changeset/ports/475282

Log:
  vboxheadless: Fix start of specific machine after base r291770.

  The vboxheadless rc script has its own pid checking, so the rc.subr
  version in run_rc_command is not needed.

  PR:		212074

Changes:
  head/emulators/virtualbox-ose/Makefile
  head/emulators/virtualbox-ose/files/vboxheadless.in
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-07-24 23:24:46 UTC
A commit references this bug:

Author: bdrewery
Date: Tue Jul 24 23:23:59 UTC 2018
New revision: 475283
URL: https://svnweb.freebsd.org/changeset/ports/475283

Log:
  MFH: r475282

  vboxheadless: Fix start of specific machine after base r291770.

  The vboxheadless rc script has its own pid checking, so the rc.subr
  version in run_rc_command is not needed.

  PR:		212074

  Approved by:	portmgr (implicit)

Changes:
_U  branches/2018Q3/
  branches/2018Q3/emulators/virtualbox-ose/Makefile
  branches/2018Q3/emulators/virtualbox-ose/files/vboxheadless.in