jobd/taskd: avoid assigning to $0
Perl allows assignments to $0 to change the argv[0] value
reported in the environment and ps-type listings.
However, this doesn't always work out so well on some systems
leading to peculiar and unwanted garbage in ps listings.
Originally the only reason the assignment to $0 was done was
to avoid leaving a relative $0 pointing nowhere after doing
chdir("/") which caused pod2usage to fail to work properly.
However, $0 is not actually used for anything after the point
at which the chdir and $0 assignment were done other than
as a default location for pod2usage and to be passed to the
basename function. But the original $0 is a better choice to
be passed to the basename function in case symbolic links are
involved because basename(realpath($0)) could end up being
different than basename($0).
Therefore remove the assigments to $0 to prevent ps-produced
process printout peculiarities, resolve $0 using realpath and
save the result in a "my" variable before using chdir("/") and
then pass the saved realpath($0) to pod2usage as the -input
argument so it can still find the source file.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>