Comments (13)
Problem solved.
The error disappears when a local variable for storing the result of the function is used.
from znapzend.
what do you mean with the local variable ?
from znapzend.
I got the error in sendRecvSnapshots with
...
my @recvCmd = $self->$buildRemoteRefArray($remote, [$mbuffer, @{$self->mbufferParam},
$mbufferSize, '-4', '-I', $mbufferPort], [$self->pfexec, 'zfs', 'recv', $recvOpt, $dstDataSet]);
...
and changed it to
my $pfexec = $self->pfexec;
my @recvCmd = $self->$buildRemoteRefArray($remote, [$mbuffer, @{$self->mbufferParam},
$mbufferSize, '-4', '-I', $mbufferPort], [$pfexec, 'zfs', 'recv', $recvOpt, $dstDataSet]);
from znapzend.
very odd that this should make a difference
from znapzend.
Unfortunately I am not a perl guru and have no idea how exxplain it.
If I compare it with other languages I would assume that the usage of the function is by reference and not by value.
And
my $pfexec = $self->pfexec;
is not a reference to the function but the result of the function.
Adn this works.
And the problem coccurs only in the forked subroutine and not in the other parts of the code.
from znapzend.
are you using an old version of perl ? from what I know of perl, this does not make a lot of sense ...
by adding the () you could enforce the notion that this is a function to be called. But as you can see in the line above where mbufferParam is called, this seems to work just fine
my @recvCmd = $self->$buildRemoteRefArray($remote, [$mbuffer, @{$self->mbufferParam},
$mbufferSize, '-4', '-I', $mbufferPort], [$self->pfexec(), 'zfs', 'recv', $recvOpt, $dstDataSet]);
from znapzend.
I deleted my branch upstream1 but there are 2 comments from you.
Of course pfexec can always be used and does not harm. It is necessary where write operations are used.
But in BSD or Linux pfexec does not exist and instead sudo must be used.
Following your comments I changed:
-
pfexec is now defined as
$self->oracleMode ? qw(pfexec) : qw();
I changed alle occurences where $self->pfexec is used as function arguments for $buildRemote to:
my @ssh = $self->$buildRemote($remote, [@{$self->pfexec}, @cmd, $zpool]);
This produces the aforementioned error
[Mon Dec 15 12:40:00 2014] [warn] taking snapshot on pool1/nfs/nfs1 failed: Can't use string ("pfexec") as an ARRAY ref while "strict refs" in use at /opt/bin/../lib/ZnapZend/ZFS.pm line 200.
- and after reading some chapters in "Programming Perl" pfexec is now defined as
$self->oracleMode ? [qw(pfexec)] : [qw()];
=> SUCCESS
Snapshots are created and send/recv to the remote site works.
from znapzend.
- returns an array (not an array reference)
- you try to dereference the array which will fail since it is not an array reference but an array
either you do 3) or you remove the dereference operator in 2)
edit:
just seen that you have 1) as an attribute (has...
), that can't be an array but only a reference to an array. so only 3) will work.
from znapzend.
It works now with 3) and is the same handling as with mbufferParams.
How to proceed?
from znapzend.
hooking this into oracleMode is unfortunate, since oracleMode actually contains stuff which fixes oracle brokenness ... while this might be something more generic ... useful for all solaris/illumos incarnations and if it was called sudo for others as well ...
maybe make it a separate option ? @hadfl ?
from znapzend.
what's the point of passwordless pfexec/sudo?
what about running it as an unpriviledged user with delegated zfs permissions?
from znapzend.
We need remote login and zfs privileges.
With the default (secure) configuration in Oracle Solaris root can’t login via ssh.
A less privileged account must be used.
This may be the case in secure environments with other Oss too.
The privileges for this account can be defined
-
with the global privileges ‘ZFS Storage Management’ and ‘ZFS File System Management’ for the system
-
or with zfs acl specific for zfs datasets/filesystems.
Von: Dominik Hassler [mailto:[email protected]]
Gesendet: Montag, 15. Dezember 2014 15:10
An: oetiker/znapzend
Cc: Grüninger, Andreas (LGL Extern)
Betreff: Re: [znapzend] Usage of less privileged account (#109)
what's the point of passwordless pfexec/sudo?
what about running it as an unpriviledged user with delegated zfs permissions?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/109#issuecomment-66998535.
from znapzend.
--> #113
--features=pfexec
in your case...
from znapzend.
Related Issues (20)
- 📦 Official Packages and Debian Repository HOT 4
- When logging to file, log file is not re-opened upon HUP HOT 6
- PR self-tests fail in docker stage: `mbuffer (no such package)` HOT 4
- Seems that for non-enabled mode we only delete snaps from the first child dataset HOT 4
- No thinning of remote snapshots HOT 6
- Missing or empty input at offset 0 at /usr/lib/Mojo/IOLoop/Subprocess.pm line 84 HOT 3
- Minor? Initial make fail on canton HOT 1
- Design problem with "enabled=off, recursion=on" handling HOT 1
- Failed to start ZnapZend - ZFS Backup System HOT 1
- Is it possible to send an encrpyted snapshot to a remote? HOT 2
- Only snapshot HOT 3
- Is this possible A -> B -> C (encr) HOT 1
- Missing docs on `oracleMode` for `znapzendzetup` HOT 2
- Ignore parent dataset with --recursive. HOT 6
- mbuffer: "operation not supported" message and not sure how to troubleshoot HOT 3
- Make README's recursive dataset snapshot pruning warning clearer HOT 1
- Feature: Add ability of DST to store snapshots as files HOT 4
- ZFS destroy snapshot causes hung_task panic HOT 5
- CI: Problem building Docker image for "Release/Docker push" scenario: repo lacks mbuffer? HOT 1
- The `mbuffer` settings relate to the remote system only, is this right? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from znapzend.