+
+###--- Internal functions ---###
+
+# Check if pakfire is already running (extend test here if necessary)
+sub _is_pakfire_busy {
+ # Get PID of a running pakfire instance
+ # (The system backpipe command is safe, because no user input is computed.)
+ my $pakfire_pid = `pidof -s /usr/local/bin/pakfire`;
+ chomp($pakfire_pid);
+
+ # Test presence of PID or lockfile
+ return (($pakfire_pid) || (-e "$Pakfire::lockfile"));
+}