Answer the question
In order to leave comments, you need to log in
What is the problem with autorun Perl script through SystemD?
When I run my script in the normal way:
/usr/bin/perl /usr/local/scripts/sc_ts.pl /usr/local/scripts/
systemctl start sc_ts
[Unit]
Description=My Perl Script
After=network.target
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/bin/perl /usr/local/scripts/sc_ts.pl /usr/local/scripts/
ExecStop=/usr/bin/killall /usr/bin/perl
[Install]
WantedBy=multi-user.target
can't locate object method "connect" via package "DBI"
Thread::State 0.09 module is not installed.
File::Scan::ClamAV module is not installed.
Mail::SPF::Query module is not installed.
Tie::RDBM module is not installed - database usage not available
!# perl -e 'print "$_\n" foreach @INC'
/root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi
/root/perl5/lib/perl5/5.16.3
/root/perl5/lib/perl5/x86_64-linux-thread-multi
/root/perl5/lib/perl5
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
!# cat .bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PERL_LOCAL_LIB_ROOT="$PERL_LOCAL_LIB_ROOT:/root/perl5";
export PERL_MB_OPT="--install_base /root/perl5";
export PERL_MM_OPT="INSTALL_BASE=/root/perl5";
export PERL5LIB="/root/perl5/lib/perl5:$PERL5LIB";
export PATH="/root/perl5/bin:$PATH";
!# echo $PATH
/root/perl5/bin:/sbin:/bin:/usr/sbin:/usr/bin
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question