Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

kill does not work #57

Open
Open

Description

@thisboyiscrazy
Rsync = require('rsync');

cmd = new Rsync()
    .flags('avz')
    .source('src/')
    .destination('dst/');

c = cmd.execute(
    function(error,code,cmd) { console.log("Done"); },
    function(data) { console.log(data.toString()); },
    function(data) { console.log(data.toString()); },
);

setTimeout(function() {
    console.log("!!!!!!!Killing!!!!!!");
    c.kill();
},4000);

Should kill the sync after 4 seconds. It does not. rsync does seem to receive the signal.

Activity

  1. thisboyiscrazy commented on Jun 13, 2017

    @thisboyiscrazy
    Author

    This seems to be debian only issue. But still it does not work as expected.

  2. mw-white commented on Jun 13, 2017

    @mw-white
    Contributor

    On Debian, /bin/sh is linked to dash. Dash doesn't seem to support job control...the solution is to set the shell to /bin/bash:

    var sync = new rsync()
      .executableShell('/bin/bash')
      .source(sourcepath)
      .destination(destpath);
    
  3. thisboyiscrazy commented on Jun 16, 2017

    @thisboyiscrazy
    Author

    Just wondering, why are you using a shell instead of just calling rsync?

            cmdProc = spawn(this.executable(), this.args(),
                            { stdio: 'pipe', cwd: this._cwd, env: this._env });
    

    seems to pass all test and work correctly on linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions