FreeBSD Bugzilla – Attachment 155583 Details for
Bug 199133
[net/vnstat] Fresh vnstat installation breaks after reboot with database file permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
vnstat.patch (text/plain), 2.50 KB, created by
Yuri Victorovich
on 2015-04-14 02:18:41 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Yuri Victorovich
Created:
2015-04-14 02:18:41 UTC
Size:
2.50 KB
patch
obsolete
>Index: net/vnstat/files/pkg-message.in >=================================================================== >--- net/vnstat/files/pkg-message.in (revision 383195) >+++ net/vnstat/files/pkg-message.in (working copy) >@@ -1,7 +1,14 @@ > ########################################################################### > vnstat has been installed. > >-A Sample configuration file has be installed in %%PREFIX%%/etc/ >+A sample configuration file has been installed in %%PREFIX%%/etc/ >+Please add your default network interface in the 'Interface' line there >+before starting vnstat service. >+You can add any number of additional interfaces either in >+vnstat_additional_ifaces variable in /etc/rc.conf, or with this command: >+su -m %%USERS%% -c "%%PREFIX%%/bin/vnstat --create --iface <your interface>" >+and restart vnstat service: >+service vnstat restart > > For more information about vnStat use "man vnstat" or visit: > http://humdi.net/vnstat/ >Index: net/vnstat/files/vnstat.in >=================================================================== >--- net/vnstat/files/vnstat.in (revision 383195) >+++ net/vnstat/files/vnstat.in (working copy) >@@ -22,15 +22,27 @@ > : ${vnstat_flags="-d --noadd"} > : ${vnstat_user:=%%USERS%%} > : ${vnstat_group:=%%GROUPS%%} >+: ${vnstat_additional_ifaces:=""} > > command="%%PREFIX%%/sbin/vnstatd" > command_args="-p ${vnstat_pidfile} --config ${vnstat_config}" > pidfile="${vnstat_pidfile}" >+user_cmd="%%PREFIX%%/bin/vnstat" > > start_precmd=vnstat_startprecmd > >+create_iface_database() { >+ local iface="$1" >+ local descr="$2" >+ su -m ${vnstat_user} -c "${user_cmd} --create --iface $iface" >/dev/null 2>&1 || >+ ! echo "$name: Failed to create database for the $descr interface $iface" || return 1 >+ echo "$name: Created the database for the $descr interface $iface" >+} >+ > vnstat_startprecmd() > { >+ local dbdir iface >+ > if [ ! -e ${pidfile%/*} ]; then > install -d -o ${vnstat_user} -g ${vnstat_group} ${pidfile%/*}; > fi >@@ -40,6 +52,18 @@ > install -d -o ${vnstat_user} -g ${vnstat_group} ${dbdir}; > fi > >+ iface=$(grep "^Interface" ${vnstat_config} | head -1 | awk 'BEGIN{FS="\042"}{print $2}') >+ if [ -n "${iface}" -a ! -f ${dbdir}/${iface} ]; then >+ create_iface_database $iface "default" || return 1 >+ fi >+ if [ -n "${vnstat_additional_ifaces}" ]; then >+ for iface in ${vnstat_additional_ifaces}; do >+ if [ ! -f ${dbdir}/${iface} ]; then >+ create_iface_database $iface "additional" || return 1 >+ fi >+ done >+ fi >+ > if [ ! -d "/var/run/vnstat" ]; then > install -d -o ${vnstat_user} -g ${vnstat_group} /var/run/vnstat; > fi
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 199133
:
155582
| 155583