Giter VIP home page Giter VIP logo

Comments (3)

longzheng avatar longzheng commented on June 17, 2024 1

I fixed by manually specifying a longer wait time, the default 2 seconds don't seem to be long enough (between uninstalling the service and deleting the daemon file).

svc.uninstall(5);

from node-windows.

seidhkona avatar seidhkona commented on June 17, 2024

I'm seeing the same issue on Windows 10. Any updates or insight on what's causing it?

from node-windows.

khelkun avatar khelkun commented on June 17, 2024
  1. Error is displayed, service is not deleted

In my case, I'd say the service is deleted from Windows services.msc, but node-windows fails to delete mydaemon.wrapper.log because it's not permitted to do it. It's clearly not a wait time issue in my case:

Error: EPERM: operation not permitted, unlink 'C:\mydaemon\daemon\ftlnodeagent.wrapper.log'
    at Object.unlinkSync (node:fs:1767:3)
    at rm (C:\Users\myuser\AppData\Roaming\npm\node_modules\node-windows\lib\daemon.js:602:22)
    at C:\Users\threedeeverse\AppData\Roaming\npm\node_modules\node-windows\lib\daemon.js:610:15
    at ChildProcess.exithandler (node:child_process:394:7)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Socket.<anonymous> (node:internal/child_process:458:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:301:12) {
  errno: -4048,
  syscall: 'unlink',
  code: 'EPERM',
  path: 'C:\\mydaemon\\daemon\\ftlnodeagent.wrapper.log'

This does happen on a VM (Windows Server 2019) but does not happen on my workstation (Windows 10). Both installs the service with logOnAs with the main administrator user from a regular command line (non elevated).
Strangely on the VM, if the svc.uninstall() is run from a regular command line, then it's not permitted to delete ftlnodeagent.wrapper.log. But if it's run from an administrator command line then it succeeds to delete ftlnodeagent.wrapper.log.
If I review the security tab of the log file properties then the "group or user names" and premissions are clearly different on the Windows Server 2019 VM.

Workaround:
Pre-create the .wrapper.log .out.log .err.log from my installation script before calling svc.install(). So the user who installs the service has permissions to delete those file when calling svc.uninstall().

from node-windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.