Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-16 Thread JING YANG
I check my journctl. I did "journalctl -u bacula-dir.service", now it show
a different error says'

Aug 15 23:56:17 thidwick bacula-dir[5858]: 15-Aug 23:56  Message delivery
ERROR: Mail program terminated in error.

   CMD=/usr/lib/bacula/bsmtp -h
localhost -f "(Bacula) " -s "Bacula: Backup OK of
thidwick-fd Incremental" root@localhost

   ERR=No such file or directory

Maybe, this will give you guys more hint on the actual problem?


Thanks,

Jing

On Sat, Aug 15, 2015 at 12:53 PM, Kern Sibbald  wrote:

> On 15.08.2015 17:44, Josip Deanovic wrote:
> > On Saturday 2015-08-15 12:15:13 Kern Sibbald wrote:
> >> Hello,
> >>
> >> I also think this may be a selinux problem.  The best way to know is if
> >> Jing understands kernel and selinux logs, he can see if there are any
> >> selinux rejections, since they will not clearly show as being a selinux
> >> problem in the Bacula messages (the OS does not furnish this info).
> >> Another way, is to simply turn selinux off temporarily.  If I am not
> >> mistaken, selinux is enabled by default on newer RedHat/CentOS systems.
> >>
> >> Best regards,
> >> Kern
> > RedHat/Centos are using selinux by default (6.x, 7.x, I don't remember
> > about 5.x any more) but the original poster said that he is using
> > archlinux. I have never used archlinux.
> >
> Good point.
>
> Another thing, if I understand Jing correctly he believes that the
> owner:group of the binary imply what "user" the FD will be running as.
> Hopefully someone help him understand that the user:group that the
> binary that is executing is determined by the user:group of who started
> the binary and what command line options were used and not by the
> user:group of the binary image.
>
>
> --
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>
--
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-15 Thread Kern Sibbald
On 15.08.2015 17:44, Josip Deanovic wrote:
> On Saturday 2015-08-15 12:15:13 Kern Sibbald wrote:
>> Hello,
>>
>> I also think this may be a selinux problem.  The best way to know is if
>> Jing understands kernel and selinux logs, he can see if there are any
>> selinux rejections, since they will not clearly show as being a selinux
>> problem in the Bacula messages (the OS does not furnish this info).
>> Another way, is to simply turn selinux off temporarily.  If I am not
>> mistaken, selinux is enabled by default on newer RedHat/CentOS systems.
>>
>> Best regards,
>> Kern
> RedHat/Centos are using selinux by default (6.x, 7.x, I don't remember
> about 5.x any more) but the original poster said that he is using
> archlinux. I have never used archlinux.
>
Good point.

Another thing, if I understand Jing correctly he believes that the
owner:group of the binary imply what "user" the FD will be running as. 
Hopefully someone help him understand that the user:group that the
binary that is executing is determined by the user:group of who started
the binary and what command line options were used and not by the
user:group of the binary image.

--
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-15 Thread Josip Deanovic
On Saturday 2015-08-15 12:15:13 Kern Sibbald wrote:
> Hello,
> 
> I also think this may be a selinux problem.  The best way to know is if
> Jing understands kernel and selinux logs, he can see if there are any
> selinux rejections, since they will not clearly show as being a selinux
> problem in the Bacula messages (the OS does not furnish this info).
> Another way, is to simply turn selinux off temporarily.  If I am not
> mistaken, selinux is enabled by default on newer RedHat/CentOS systems.
> 
> Best regards,
> Kern

RedHat/Centos are using selinux by default (6.x, 7.x, I don't remember
about 5.x any more) but the original poster said that he is using
archlinux. I have never used archlinux.

-- 
Josip Deanovic

--
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-15 Thread Josh Fisher



On 8/14/2015 8:00 PM, JING YANG wrote:

Dear Ana,
   It is like this,

-rw-r- 1 bacula bacula 5 Aug 14 02:19 bacula-sd.9103.pid



Are you sure that bacula-sd runs as bacula:bacula and not bacula:tape?


-rw-r- 1 root   root   5 Aug 14 02:19 bacula-fd.9102.pid

-rw-r- 1 bacula bacula 5 Aug 14 11:05 bacula-dir.9101.pid

anything wrong here?

Thanks,

Jing


On Fri, Aug 14, 2015 at 2:58 PM, Ana Emília M. Arruda 
mailto:emiliaarr...@gmail.com>> wrote:


Hello Jing,

Have you checked the write permissions on your Pid Directory?

PIDFILE=/var/run/bacula/$NAME.$PORT.pid

Best regards,
Ana

Em sex, 14 de ago de 2015 às 14:07, Jing At Penn
mailto:yan...@sas.upenn.edu>> escreveu:

Dear Josip,
 I really appreciate your help. I am using archlinux.
I figured the system daemon configuration file is running
under /use/lib/systemd/system/bacula-fd.service. So I changed
the user and group in there. Now, I checked "ps aux | grep
bacula-fd" it's running as root. However, I still get the
permission error. I am running out of ideas right.
Desperate for your help

Thanks,
Jing


> On Aug 13, 2015, at 7:15 AM, Josip Deanovic
mailto:djosip%2bn...@linuxpages.net>> wrote:
>
>> On Tuesday 2015-08-11 17:40:17 Jing Yang wrote:
>> Here is my init.d script file, i did not see the -u option
…. BUSER and
>> BGROUP are the two things some other mailing list user told
me to put
>> there, however, that does not work either.
>
> Hi!
>
> I am not sure what OS you are using so my advice here could
probably
> be improved if you use the solution more suitable for your
system.
>
> If you just want to start the bacula-fd daemon using that
init script
> and see how it works you can modify this line:
> ARGS="-c /etc/bacula/${NAME}.conf"
> so that it looks like this:
> ARGS="-c /etc/bacula/${NAME}.conf -u root -g root"
>
> The content of the ARGS variable is later in the function
do_start()
> passed to the command which will execute the bacula-fd daemon.
>
> After starting bacula-fd using that modified init script,
bacula-fd
> should run as root. You can check the process list as before to
> ensure that.
>
> Again, most systems support some procedure that can be used to
> source (include) additional file with additional options and
> variables.
>
> I would suggest that you find the best way to supply additional
> parameters to the init scripts on your system because modified
> init scripts are likely to be overwritten during the update of
> the related package.
>
>
>> #!/bin/sh
>> ### BEGIN INIT INFO
>> # Provides:  bacula-fd
>> # Required-Start:$remote_fs $syslog
>> # Required-Stop: $remote_fs $syslog
>> # Should-Start:  bacula-sd
>> # Should-Stop:   bacula-sd
>> # Default-Start: 2 3 4 5
>> # Default-Stop:  0 1 6
>> ### END INIT INFO
>> #
>> # bacula-fd SysV init script for Bacula-FD.
>> #
>> #   Written by Miquel van Smoorenburg
mailto:miqu...@cistron.nl>>.
>> #   Modified for Debian GNU/Linux by Ian Murdock
>> mailto:imurd...@gnu.ai.mit.edu>>.
#   Customized for Bacula by Jose Luis
>> Tallon mailto:jltal...@adv-solutions.net>> #
>>
>> . /lib/lsb/init-functions
>>
>> NAME="bacula-fd"
>> DESC="Bacula File daemon"
>> PATH=/sbin:/bin:/usr/sbin:/usr/bin
>> DAEMON=/usr/sbin/${NAME}
>> BUSER=root
>> BGROUP=root
>> PORT=9102
>> ARGS="-c /etc/bacula/${NAME}.conf"
>>
>> test -f $DAEMON || exit 0
>>
>> set -e
>>
>> if [ -n "`getent services bacula-fd`" ]; then
>>PORT=`getent services bacula-fd | awk '{
gsub("/tcp","",$2);
>> print $2; }'` fi
>>
>> . /lib/lsb/init-functions
>> . /usr/share/bacula-common/common-functions
>> create_var_run_dir
>>
>> PIDFILE=/var/run/bacula/$NAME.$PORT.pid
>>
>> do_start()
>> {
>>start-stop-daemon --start --quiet --pidfile $PIDFILE \
>>--exec $DAEMON -- $ARGS
>> }
>>
>> do_stop()
>> {
>>start-stop-daemon --oknodo --stop --quiet --pidfile
$PIDFILE \
>>--exec $DAEMON
>> }
>>
>> case "$1" in
>>  start)
>>if [ -f /etc/bacula/do_not_run ]; then
>>log_f

Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-15 Thread Kern Sibbald
Hello,

I also think this may be a selinux problem.  The best way to know is if
Jing understands kernel and selinux logs, he can see if there are any
selinux rejections, since they will not clearly show as being a selinux
problem in the Bacula messages (the OS does not furnish this info). 
Another way, is to simply turn selinux off temporarily.  If I am not
mistaken, selinux is enabled by default on newer RedHat/CentOS systems.

Best regards,
Kern

On 15.08.2015 10:53, Josip Deanovic wrote:
> On Friday 2015-08-14 22:37:48 Ana Emília M. Arruda wrote:
>> Hello Jing,
>>
>> I misunderstood the issue. You are able to start the client file daemon.
>> Could you post the “permission denied” error messages you are getting?
>>
>> Best regards,
>> Ana
> It might be related to selinux if selinux is in use.
> Let's see that “permission denied” error messages.
>


--
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-15 Thread Josip Deanovic
On Friday 2015-08-14 22:37:48 Ana Emília M. Arruda wrote:
> Hello Jing,
> 
> I misunderstood the issue. You are able to start the client file daemon.
> Could you post the “permission denied” error messages you are getting?
> 
> Best regards,
> Ana

It might be related to selinux if selinux is in use.
Let's see that “permission denied” error messages.

-- 
Josip Deanovic

--
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-14 Thread Ana Emília M . Arruda
Hello Jing,

I misunderstood the issue. You are able to start the client file daemon.
Could you post the “permission denied” error messages you are getting?

Best regards,
Ana

On Fri, Aug 14, 2015 at 9:00 PM, JING YANG  wrote:

> Dear Ana,
>It is like this,
>
> -rw-r- 1 bacula bacula 5 Aug 14 02:19 bacula-sd.9103.pid
>
> -rw-r- 1 root   root   5 Aug 14 02:19 bacula-fd.9102.pid
>
> -rw-r- 1 bacula bacula 5 Aug 14 11:05 bacula-dir.9101.pid
>
> anything wrong here?
>
> Thanks,
>
> Jing
>
> On Fri, Aug 14, 2015 at 2:58 PM, Ana Emília M. Arruda <
> emiliaarr...@gmail.com> wrote:
>
>> Hello Jing,
>>
>> Have you checked the write permissions on your Pid Directory?
>>
>> PIDFILE=/var/run/bacula/$NAME.$PORT.pid
>>
>> Best regards,
>> Ana
>>
>> Em sex, 14 de ago de 2015 às 14:07, Jing At Penn 
>> escreveu:
>>
>>> Dear Josip,
>>>  I really appreciate your help. I am using archlinux. I figured
>>> the system daemon configuration file is running under
>>> /use/lib/systemd/system/bacula-fd.service. So I changed the user and group
>>> in there. Now, I checked "ps aux | grep bacula-fd" it's running as root.
>>> However, I still get the permission error. I am running out of ideas
>>> right. Desperate for your help
>>>
>>> Thanks,
>>> Jing
>>>
>>>
>>> > On Aug 13, 2015, at 7:15 AM, Josip Deanovic <
>>> djosip+n...@linuxpages.net> wrote:
>>> >
>>> >> On Tuesday 2015-08-11 17:40:17 Jing Yang wrote:
>>> >> Here is my init.d script file, i did not see the -u option …. BUSER
>>> and
>>> >> BGROUP are the two things some other mailing list user told me to put
>>> >> there, however, that does not work either.
>>> >
>>> > Hi!
>>> >
>>> > I am not sure what OS you are using so my advice here could probably
>>> > be improved if you use the solution more suitable for your system.
>>> >
>>> > If you just want to start the bacula-fd daemon using that init script
>>> > and see how it works you can modify this line:
>>> > ARGS="-c /etc/bacula/${NAME}.conf"
>>> > so that it looks like this:
>>> > ARGS="-c /etc/bacula/${NAME}.conf -u root -g root"
>>> >
>>> > The content of the ARGS variable is later in the function do_start()
>>> > passed to the command which will execute the bacula-fd daemon.
>>> >
>>> > After starting bacula-fd using that modified init script, bacula-fd
>>> > should run as root. You can check the process list as before to
>>> > ensure that.
>>> >
>>> > Again, most systems support some procedure that can be used to
>>> > source (include) additional file with additional options and
>>> > variables.
>>> >
>>> > I would suggest that you find the best way to supply additional
>>> > parameters to the init scripts on your system because modified
>>> > init scripts are likely to be overwritten during the update of
>>> > the related package.
>>> >
>>> >
>>> >> #!/bin/sh
>>> >> ### BEGIN INIT INFO
>>> >> # Provides:  bacula-fd
>>> >> # Required-Start:$remote_fs $syslog
>>> >> # Required-Stop: $remote_fs $syslog
>>> >> # Should-Start:  bacula-sd
>>> >> # Should-Stop:   bacula-sd
>>> >> # Default-Start: 2 3 4 5
>>> >> # Default-Stop:  0 1 6
>>> >> ### END INIT INFO
>>> >> #
>>> >> # bacula-fd SysV init script for Bacula-FD.
>>> >> #
>>> >> #   Written by Miquel van Smoorenburg .
>>> >> #   Modified for Debian GNU/Linux by Ian Murdock
>>> >> . #   Customized for Bacula by Jose Luis
>>> >> Tallon  #
>>> >>
>>> >> . /lib/lsb/init-functions
>>> >>
>>> >> NAME="bacula-fd"
>>> >> DESC="Bacula File daemon"
>>> >> PATH=/sbin:/bin:/usr/sbin:/usr/bin
>>> >> DAEMON=/usr/sbin/${NAME}
>>> >> BUSER=root
>>> >> BGROUP=root
>>> >> PORT=9102
>>> >> ARGS="-c /etc/bacula/${NAME}.conf"
>>> >>
>>> >> test -f $DAEMON || exit 0
>>> >>
>>> >> set -e
>>> >>
>>> >> if [ -n "`getent services bacula-fd`" ]; then
>>> >>PORT=`getent services bacula-fd | awk '{ gsub("/tcp","",$2);
>>> >> print $2; }'` fi
>>> >>
>>> >> . /lib/lsb/init-functions
>>> >> . /usr/share/bacula-common/common-functions
>>> >> create_var_run_dir
>>> >>
>>> >> PIDFILE=/var/run/bacula/$NAME.$PORT.pid
>>> >>
>>> >> do_start()
>>> >> {
>>> >>start-stop-daemon --start --quiet --pidfile $PIDFILE \
>>> >>--exec $DAEMON -- $ARGS
>>> >> }
>>> >>
>>> >> do_stop()
>>> >> {
>>> >>start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
>>> >>--exec $DAEMON
>>> >> }
>>> >>
>>> >> case "$1" in
>>> >>  start)
>>> >>if [ -f /etc/bacula/do_not_run ]; then
>>> >>log_failure_msg "Not starting $DESC: disabled via
>>> >> /etc/bacula/do_not_run" exit 0
>>> >>fi
>>> >>
>>> >>log_daemon_msg "Starting $DESC..."
>>> >>if do_start ; then
>>> >>log_end_msg 0
>>> >>else
>>> >>log_end_msg 1
>>> >>fi
>>> >>;;
>>> >>  stop)
>>> >>log_daemon_msg "Stopping $DESC..."
>>> >>if do_stop ; then
>>> >>log_end_msg 0
>>> >>else
>>> >>log_end_msg

Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-14 Thread JING YANG
Dear Ana,
   It is like this,

-rw-r- 1 bacula bacula 5 Aug 14 02:19 bacula-sd.9103.pid

-rw-r- 1 root   root   5 Aug 14 02:19 bacula-fd.9102.pid

-rw-r- 1 bacula bacula 5 Aug 14 11:05 bacula-dir.9101.pid

anything wrong here?

Thanks,

Jing

On Fri, Aug 14, 2015 at 2:58 PM, Ana Emília M. Arruda <
emiliaarr...@gmail.com> wrote:

> Hello Jing,
>
> Have you checked the write permissions on your Pid Directory?
>
> PIDFILE=/var/run/bacula/$NAME.$PORT.pid
>
> Best regards,
> Ana
>
> Em sex, 14 de ago de 2015 às 14:07, Jing At Penn 
> escreveu:
>
>> Dear Josip,
>>  I really appreciate your help. I am using archlinux. I figured
>> the system daemon configuration file is running under
>> /use/lib/systemd/system/bacula-fd.service. So I changed the user and group
>> in there. Now, I checked "ps aux | grep bacula-fd" it's running as root.
>> However, I still get the permission error. I am running out of ideas
>> right. Desperate for your help
>>
>> Thanks,
>> Jing
>>
>>
>> > On Aug 13, 2015, at 7:15 AM, Josip Deanovic 
>> wrote:
>> >
>> >> On Tuesday 2015-08-11 17:40:17 Jing Yang wrote:
>> >> Here is my init.d script file, i did not see the -u option …. BUSER and
>> >> BGROUP are the two things some other mailing list user told me to put
>> >> there, however, that does not work either.
>> >
>> > Hi!
>> >
>> > I am not sure what OS you are using so my advice here could probably
>> > be improved if you use the solution more suitable for your system.
>> >
>> > If you just want to start the bacula-fd daemon using that init script
>> > and see how it works you can modify this line:
>> > ARGS="-c /etc/bacula/${NAME}.conf"
>> > so that it looks like this:
>> > ARGS="-c /etc/bacula/${NAME}.conf -u root -g root"
>> >
>> > The content of the ARGS variable is later in the function do_start()
>> > passed to the command which will execute the bacula-fd daemon.
>> >
>> > After starting bacula-fd using that modified init script, bacula-fd
>> > should run as root. You can check the process list as before to
>> > ensure that.
>> >
>> > Again, most systems support some procedure that can be used to
>> > source (include) additional file with additional options and
>> > variables.
>> >
>> > I would suggest that you find the best way to supply additional
>> > parameters to the init scripts on your system because modified
>> > init scripts are likely to be overwritten during the update of
>> > the related package.
>> >
>> >
>> >> #!/bin/sh
>> >> ### BEGIN INIT INFO
>> >> # Provides:  bacula-fd
>> >> # Required-Start:$remote_fs $syslog
>> >> # Required-Stop: $remote_fs $syslog
>> >> # Should-Start:  bacula-sd
>> >> # Should-Stop:   bacula-sd
>> >> # Default-Start: 2 3 4 5
>> >> # Default-Stop:  0 1 6
>> >> ### END INIT INFO
>> >> #
>> >> # bacula-fd SysV init script for Bacula-FD.
>> >> #
>> >> #   Written by Miquel van Smoorenburg .
>> >> #   Modified for Debian GNU/Linux by Ian Murdock
>> >> . #   Customized for Bacula by Jose Luis
>> >> Tallon  #
>> >>
>> >> . /lib/lsb/init-functions
>> >>
>> >> NAME="bacula-fd"
>> >> DESC="Bacula File daemon"
>> >> PATH=/sbin:/bin:/usr/sbin:/usr/bin
>> >> DAEMON=/usr/sbin/${NAME}
>> >> BUSER=root
>> >> BGROUP=root
>> >> PORT=9102
>> >> ARGS="-c /etc/bacula/${NAME}.conf"
>> >>
>> >> test -f $DAEMON || exit 0
>> >>
>> >> set -e
>> >>
>> >> if [ -n "`getent services bacula-fd`" ]; then
>> >>PORT=`getent services bacula-fd | awk '{ gsub("/tcp","",$2);
>> >> print $2; }'` fi
>> >>
>> >> . /lib/lsb/init-functions
>> >> . /usr/share/bacula-common/common-functions
>> >> create_var_run_dir
>> >>
>> >> PIDFILE=/var/run/bacula/$NAME.$PORT.pid
>> >>
>> >> do_start()
>> >> {
>> >>start-stop-daemon --start --quiet --pidfile $PIDFILE \
>> >>--exec $DAEMON -- $ARGS
>> >> }
>> >>
>> >> do_stop()
>> >> {
>> >>start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
>> >>--exec $DAEMON
>> >> }
>> >>
>> >> case "$1" in
>> >>  start)
>> >>if [ -f /etc/bacula/do_not_run ]; then
>> >>log_failure_msg "Not starting $DESC: disabled via
>> >> /etc/bacula/do_not_run" exit 0
>> >>fi
>> >>
>> >>log_daemon_msg "Starting $DESC..."
>> >>if do_start ; then
>> >>log_end_msg 0
>> >>else
>> >>log_end_msg 1
>> >>fi
>> >>;;
>> >>  stop)
>> >>log_daemon_msg "Stopping $DESC..."
>> >>if do_stop ; then
>> >>log_end_msg 0
>> >>else
>> >>log_end_msg 1
>> >>fi
>> >>;;
>> >>
>> >>  restart|force-reload)
>> >>$0 stop
>> >>sleep 1
>> >>$0 start
>> >>;;
>> >>  status)
>> >>status_of_proc -p $PIDFILE $DAEMON $NAME
>> >>;;
>> >>  *)
>> >>N=/etc/init.d/$NAME
>> >>echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
>> >>exit 1
>> >>;;
>> >> esac
>> >>
>> >> exit 0
>> >
>

Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-14 Thread Ana Emília M . Arruda
Hello Jing,

Have you checked the write permissions on your Pid Directory?

PIDFILE=/var/run/bacula/$NAME.$PORT.pid

Best regards,
Ana
Em sex, 14 de ago de 2015 às 14:07, Jing At Penn 
escreveu:

> Dear Josip,
>  I really appreciate your help. I am using archlinux. I figured
> the system daemon configuration file is running under
> /use/lib/systemd/system/bacula-fd.service. So I changed the user and group
> in there. Now, I checked "ps aux | grep bacula-fd" it's running as root.
> However, I still get the permission error. I am running out of ideas
> right. Desperate for your help
>
> Thanks,
> Jing
>
>
> > On Aug 13, 2015, at 7:15 AM, Josip Deanovic 
> wrote:
> >
> >> On Tuesday 2015-08-11 17:40:17 Jing Yang wrote:
> >> Here is my init.d script file, i did not see the -u option …. BUSER and
> >> BGROUP are the two things some other mailing list user told me to put
> >> there, however, that does not work either.
> >
> > Hi!
> >
> > I am not sure what OS you are using so my advice here could probably
> > be improved if you use the solution more suitable for your system.
> >
> > If you just want to start the bacula-fd daemon using that init script
> > and see how it works you can modify this line:
> > ARGS="-c /etc/bacula/${NAME}.conf"
> > so that it looks like this:
> > ARGS="-c /etc/bacula/${NAME}.conf -u root -g root"
> >
> > The content of the ARGS variable is later in the function do_start()
> > passed to the command which will execute the bacula-fd daemon.
> >
> > After starting bacula-fd using that modified init script, bacula-fd
> > should run as root. You can check the process list as before to
> > ensure that.
> >
> > Again, most systems support some procedure that can be used to
> > source (include) additional file with additional options and
> > variables.
> >
> > I would suggest that you find the best way to supply additional
> > parameters to the init scripts on your system because modified
> > init scripts are likely to be overwritten during the update of
> > the related package.
> >
> >
> >> #!/bin/sh
> >> ### BEGIN INIT INFO
> >> # Provides:  bacula-fd
> >> # Required-Start:$remote_fs $syslog
> >> # Required-Stop: $remote_fs $syslog
> >> # Should-Start:  bacula-sd
> >> # Should-Stop:   bacula-sd
> >> # Default-Start: 2 3 4 5
> >> # Default-Stop:  0 1 6
> >> ### END INIT INFO
> >> #
> >> # bacula-fd SysV init script for Bacula-FD.
> >> #
> >> #   Written by Miquel van Smoorenburg .
> >> #   Modified for Debian GNU/Linux by Ian Murdock
> >> . #   Customized for Bacula by Jose Luis
> >> Tallon  #
> >>
> >> . /lib/lsb/init-functions
> >>
> >> NAME="bacula-fd"
> >> DESC="Bacula File daemon"
> >> PATH=/sbin:/bin:/usr/sbin:/usr/bin
> >> DAEMON=/usr/sbin/${NAME}
> >> BUSER=root
> >> BGROUP=root
> >> PORT=9102
> >> ARGS="-c /etc/bacula/${NAME}.conf"
> >>
> >> test -f $DAEMON || exit 0
> >>
> >> set -e
> >>
> >> if [ -n "`getent services bacula-fd`" ]; then
> >>PORT=`getent services bacula-fd | awk '{ gsub("/tcp","",$2);
> >> print $2; }'` fi
> >>
> >> . /lib/lsb/init-functions
> >> . /usr/share/bacula-common/common-functions
> >> create_var_run_dir
> >>
> >> PIDFILE=/var/run/bacula/$NAME.$PORT.pid
> >>
> >> do_start()
> >> {
> >>start-stop-daemon --start --quiet --pidfile $PIDFILE \
> >>--exec $DAEMON -- $ARGS
> >> }
> >>
> >> do_stop()
> >> {
> >>start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
> >>--exec $DAEMON
> >> }
> >>
> >> case "$1" in
> >>  start)
> >>if [ -f /etc/bacula/do_not_run ]; then
> >>log_failure_msg "Not starting $DESC: disabled via
> >> /etc/bacula/do_not_run" exit 0
> >>fi
> >>
> >>log_daemon_msg "Starting $DESC..."
> >>if do_start ; then
> >>log_end_msg 0
> >>else
> >>log_end_msg 1
> >>fi
> >>;;
> >>  stop)
> >>log_daemon_msg "Stopping $DESC..."
> >>if do_stop ; then
> >>log_end_msg 0
> >>else
> >>log_end_msg 1
> >>fi
> >>;;
> >>
> >>  restart|force-reload)
> >>$0 stop
> >>sleep 1
> >>$0 start
> >>;;
> >>  status)
> >>status_of_proc -p $PIDFILE $DAEMON $NAME
> >>;;
> >>  *)
> >>N=/etc/init.d/$NAME
> >>echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
> >>exit 1
> >>;;
> >> esac
> >>
> >> exit 0
> >
> >
> > --
> > Josip Deanovic
> >
> >
> --
> > ___
> > Bacula-users mailing list
> > Bacula-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bacula-users
>
>
> --
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https:/

Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-14 Thread Jing At Penn
Dear Josip,
 I really appreciate your help. I am using archlinux. I figured the 
system daemon configuration file is running under 
/use/lib/systemd/system/bacula-fd.service. So I changed the user and group in 
there. Now, I checked "ps aux | grep bacula-fd" it's running as root. However, 
I still get the permission error. I am running out of ideas right. 
Desperate for your help

Thanks,
Jing


> On Aug 13, 2015, at 7:15 AM, Josip Deanovic  
> wrote:
> 
>> On Tuesday 2015-08-11 17:40:17 Jing Yang wrote:
>> Here is my init.d script file, i did not see the -u option …. BUSER and
>> BGROUP are the two things some other mailing list user told me to put
>> there, however, that does not work either.
> 
> Hi!
> 
> I am not sure what OS you are using so my advice here could probably
> be improved if you use the solution more suitable for your system.
> 
> If you just want to start the bacula-fd daemon using that init script
> and see how it works you can modify this line:
> ARGS="-c /etc/bacula/${NAME}.conf"
> so that it looks like this:
> ARGS="-c /etc/bacula/${NAME}.conf -u root -g root"
> 
> The content of the ARGS variable is later in the function do_start()
> passed to the command which will execute the bacula-fd daemon.
> 
> After starting bacula-fd using that modified init script, bacula-fd
> should run as root. You can check the process list as before to
> ensure that.
> 
> Again, most systems support some procedure that can be used to
> source (include) additional file with additional options and
> variables.
> 
> I would suggest that you find the best way to supply additional
> parameters to the init scripts on your system because modified
> init scripts are likely to be overwritten during the update of
> the related package.
> 
> 
>> #!/bin/sh
>> ### BEGIN INIT INFO
>> # Provides:  bacula-fd
>> # Required-Start:$remote_fs $syslog
>> # Required-Stop: $remote_fs $syslog
>> # Should-Start:  bacula-sd
>> # Should-Stop:   bacula-sd
>> # Default-Start: 2 3 4 5
>> # Default-Stop:  0 1 6
>> ### END INIT INFO
>> #
>> # bacula-fd SysV init script for Bacula-FD.
>> #
>> #   Written by Miquel van Smoorenburg .
>> #   Modified for Debian GNU/Linux by Ian Murdock
>> . #   Customized for Bacula by Jose Luis
>> Tallon  #
>> 
>> . /lib/lsb/init-functions
>> 
>> NAME="bacula-fd"
>> DESC="Bacula File daemon"
>> PATH=/sbin:/bin:/usr/sbin:/usr/bin
>> DAEMON=/usr/sbin/${NAME}
>> BUSER=root
>> BGROUP=root
>> PORT=9102
>> ARGS="-c /etc/bacula/${NAME}.conf"
>> 
>> test -f $DAEMON || exit 0
>> 
>> set -e
>> 
>> if [ -n "`getent services bacula-fd`" ]; then
>>PORT=`getent services bacula-fd | awk '{ gsub("/tcp","",$2);
>> print $2; }'` fi
>> 
>> . /lib/lsb/init-functions
>> . /usr/share/bacula-common/common-functions
>> create_var_run_dir
>> 
>> PIDFILE=/var/run/bacula/$NAME.$PORT.pid
>> 
>> do_start()
>> {
>>start-stop-daemon --start --quiet --pidfile $PIDFILE \
>>--exec $DAEMON -- $ARGS
>> }
>> 
>> do_stop()
>> {
>>start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
>>--exec $DAEMON
>> }
>> 
>> case "$1" in
>>  start)
>>if [ -f /etc/bacula/do_not_run ]; then
>>log_failure_msg "Not starting $DESC: disabled via
>> /etc/bacula/do_not_run" exit 0
>>fi
>> 
>>log_daemon_msg "Starting $DESC..."
>>if do_start ; then
>>log_end_msg 0
>>else
>>log_end_msg 1
>>fi
>>;;
>>  stop)
>>log_daemon_msg "Stopping $DESC..."
>>if do_stop ; then
>>log_end_msg 0
>>else
>>log_end_msg 1
>>fi
>>;;
>> 
>>  restart|force-reload)
>>$0 stop
>>sleep 1
>>$0 start
>>;;
>>  status)
>>status_of_proc -p $PIDFILE $DAEMON $NAME
>>;;
>>  *)
>>N=/etc/init.d/$NAME
>>echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
>>exit 1
>>;;
>> esac
>> 
>> exit 0
> 
> 
> -- 
> Josip Deanovic
> 
> --
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users

--
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-13 Thread Josip Deanovic
On Tuesday 2015-08-11 17:40:17 Jing Yang wrote:
> Here is my init.d script file, i did not see the -u option …. BUSER and
> BGROUP are the two things some other mailing list user told me to put
> there, however, that does not work either.

Hi!

I am not sure what OS you are using so my advice here could probably
be improved if you use the solution more suitable for your system.

If you just want to start the bacula-fd daemon using that init script
and see how it works you can modify this line:
 ARGS="-c /etc/bacula/${NAME}.conf"
so that it looks like this:
 ARGS="-c /etc/bacula/${NAME}.conf -u root -g root"

The content of the ARGS variable is later in the function do_start()
passed to the command which will execute the bacula-fd daemon.

After starting bacula-fd using that modified init script, bacula-fd
should run as root. You can check the process list as before to
ensure that.

Again, most systems support some procedure that can be used to
source (include) additional file with additional options and
variables.

I would suggest that you find the best way to supply additional
parameters to the init scripts on your system because modified
init scripts are likely to be overwritten during the update of
the related package.


> #!/bin/sh
> ### BEGIN INIT INFO
> # Provides:  bacula-fd
> # Required-Start:$remote_fs $syslog
> # Required-Stop: $remote_fs $syslog
> # Should-Start:  bacula-sd
> # Should-Stop:   bacula-sd
> # Default-Start: 2 3 4 5
> # Default-Stop:  0 1 6
> ### END INIT INFO
> #
> # bacula-fd SysV init script for Bacula-FD.
> #
> #   Written by Miquel van Smoorenburg .
> #   Modified for Debian GNU/Linux by Ian Murdock
> . #   Customized for Bacula by Jose Luis
> Tallon  #
> 
> . /lib/lsb/init-functions
> 
> NAME="bacula-fd"
> DESC="Bacula File daemon"
> PATH=/sbin:/bin:/usr/sbin:/usr/bin
> DAEMON=/usr/sbin/${NAME}
> BUSER=root
> BGROUP=root
> PORT=9102
> ARGS="-c /etc/bacula/${NAME}.conf"
> 
> test -f $DAEMON || exit 0
> 
> set -e
> 
> if [ -n "`getent services bacula-fd`" ]; then
> PORT=`getent services bacula-fd | awk '{ gsub("/tcp","",$2);
> print $2; }'` fi
> 
> . /lib/lsb/init-functions
> . /usr/share/bacula-common/common-functions
> create_var_run_dir
> 
> PIDFILE=/var/run/bacula/$NAME.$PORT.pid
> 
> do_start()
> {
> start-stop-daemon --start --quiet --pidfile $PIDFILE \
> --exec $DAEMON -- $ARGS
> }
> 
> do_stop()
> {
> start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
> --exec $DAEMON
> }
> 
> case "$1" in
>   start)
> if [ -f /etc/bacula/do_not_run ]; then
> log_failure_msg "Not starting $DESC: disabled via
> /etc/bacula/do_not_run" exit 0
> fi
> 
> log_daemon_msg "Starting $DESC..."
> if do_start ; then
> log_end_msg 0
> else
> log_end_msg 1
> fi
> ;;
>   stop)
> log_daemon_msg "Stopping $DESC..."
> if do_stop ; then
> log_end_msg 0
> else
> log_end_msg 1
> fi
> ;;
> 
>   restart|force-reload)
> $0 stop
> sleep 1
> $0 start
> ;;
>   status)
> status_of_proc -p $PIDFILE $DAEMON $NAME
> ;;
>   *)
> N=/etc/init.d/$NAME
> echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
> exit 1
> ;;
> esac
> 
> exit 0


-- 
Josip Deanovic

--
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-11 Thread Josip Deanovic
On Tuesday 2015-08-11 11:24:49 JING YANG wrote:
> Dear Josip,
>Thank you for your reply. ps aux | grep bacula-fd gives me the
> following:
> 
> bacula   31630  0.0  0.1 198364  2936 ?Ssl  11:09   0:00
> /usr/bin/bacula-fd -c /etc/bacula/bacula-fd.conf
> 
> Does this look right? I have checked all the possible places for
> bacula-fd, all the permissions seem correct. I tried Heitor's way, but
> no luck. I am considering reinstall the bacula. If I do that, will all
> the previous backup be lost? Or, is there any other way I can somehow
> solve this problem?
> 
> Thanks,
> 
> Jing

Hi Jing,

There is no need for reinstallation of the bacula (unless you really
messed up something with its binaries and libraries).

Have you checked your bacula init script for clues where additional
initscript configuration could be found?
For example, on RHEL/Centos and bacula 7.x I have file 
/etc/sysconfig/bacula-fd which contains variables that can define a
user you want bacula to run with.

About the ps aux...
The line you have posted clearly shows that your bacula-fd daemon
is running as user called "bacula".
That is fine if you only need to backup files readable by the user called
bacula but if you want to backup complete system you almost certainly
want your bacula-fd daemon to be run as root.

So, check your initscript "/etc/init.d/bacula-fd". Look for variables
that are used as a parameter for the bacula-fd's "-u" option and look
for the files that might be included (sourced) from the initscript.
It is likely that the sourced file will contain few variables which
could be used to specify a user and a group your want your bacula-fd
daemon to run as.

-- 
Josip Deanovic

--
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-11 Thread Heitor Faria
> Hi,
>  I have been searching around a lot about “permission denied” errors, 
> however,
>  none of them matches my case. I am keeping getting Permission denied 
> error on
>  bacula-fd daemon. In the manual, it says that run the file system daemon 
> as
>  root. I am assuming it means the following,
> "-rw-r- 1 root   bacula 1012 Mar  6  2013 bacula-fd.conf”
> However, it seems not working at all. In addition, I keep other configuration
> files with user as bacula and group as bacula. Is this the correct? How can I
> check whether the daemon is running as root user or some others? What does the
> manual mean by “run file system daemon as root”?

Hello Jing: vi /etc/init.d/bacula-fd
...
NAME="bacula-fd"
DESC="Bacula File Daemon"
DAEMON=/usr/sbin/${NAME}
BUSER=
BGROUP=
BOPTIONS="-c /etc/bacula/${NAME}.conf"
BPORT=9102
...
Regards,
===
Heitor Medrado de Faria - LPIC-III | ITIL-F |  Bacula Systems Certified 
Administrator II
Do you need Bacula training? 
https://www.udemy.com/bacula-backup-software/?couponCode=bacula-list
+55 61 8268-4220
Site: http://bacula.us FB: heitor.faria 
===


> 
> Thanks,
> Jing
> 
> 
> 
> --
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users

--
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-11 Thread Josip Deanovic
On Tuesday 2015-08-11 02:40:01 Jing Yang wrote:
> Hi,
>   I have been searching around a lot about “permission denied”
> errors, however, none of them matches my case. I am keeping getting
> Permission denied error on bacula-fd daemon. In the manual, it says
> that run the file system daemon as root. I am assuming it means the
> following, "-rw-r- 1 root   bacula 1012 Mar  6  2013
> bacula-fd.conf”
> However, it seems not working at all. In addition, I keep other
> configuration files with user as bacula and group as bacula. Is this
> the correct? How can I check whether the daemon is running as root user
> or some others? What does the manual mean by “run file system daemon as
> root”?
> 
> Thanks,
> Jing


It means that the bacula-fd process should be owned by root.
You can check that with ps command, e.g. ps aux | grep bacula-fd

It might be a good idea to get to know how unix works and get
familiarize with the basic and common unix/linux commands before
you continue playing with backup systems.

bacula-fd binary itself supports the option "-u" which is used to
specify the user bacula-fd should use.

You are probably going to use init script provided for easier
bacula-fd starting/stopping and looking into that init script might
give you an idea how to specify the user for the bacula-fd.

For example, on RHEL/Centos, bacula-fd init script would source the
file /etc/sysconfig/bacula-fd which contains variables used to define
the user for the bacula-fd daemon.

Almost certainly you want bacula-fd to run as root but this depends on
your specific needs. In any case you should ensure that bacula-fd
init script is executed by root (like any other init script on the
system).


-- 
Josip Deanovic

--
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] bacula-fd cannot access files from the system still getting [permission denied]

2015-08-10 Thread Jing Yang
Hi,
  I have been searching around a lot about “permission denied” errors, 
however, none of them matches my case. I am keeping getting Permission denied 
error on bacula-fd daemon. In the manual, it says that run the file system 
daemon as root. I am assuming it means the following,
"-rw-r- 1 root   bacula 1012 Mar  6  2013 bacula-fd.conf”
However, it seems not working at all. In addition, I keep other configuration 
files with user as bacula and group as bacula. Is this the correct? How can I 
check whether the daemon is running as root user or some others? What does the 
manual mean by “run file system daemon as root”? 

Thanks,
Jing



--
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users