asbru-cm / asbru-cm

Ásbrú Connection Manager is a user interface that helps organizing remote terminal sessions and automating repetitive tasks.

Home Page:https://www.asbru-cm.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Operation not permitted" when using a shared directory (smb/cifs) as config-dir

liprox opened this issue · comments

HI,
I love asbru since a long time, and also spend some money ... ;-)

my aim is to work with one other person together with the same asbru directory or rather with only one asbru.yml file for both.
my system: debian bullseye.

I try to copy everything to an shared directory, and change the paths to the new ones in the asbru.yml and delete the asbru.nfreeze ....
than I start it with the config-dir option, like this:
asbru-cm --config-dir=/srv/cd_fc/sys/test01/asbru/

the second try was the same copy to the shared directory, but no paths changes, because with this try I work with a symlink from the shared directory to the the default ~/.config/asbru/ directory with the following command:
ln -s -i /srv/cd_fc/sys/asbru /home/gerd/.config/asbru
now I start asbru like normal, with the Icon or asbru-cm:

But always with the same ERROR:
starting at the line "*** unhandled exception in callback:" here is the whole issue:

22:14gerd@lotte> asbru-cm 
INFO: Ásbrú Connection Manager 6.4.0 (asbru-cm) started with PID 33094
INFO: Language detected : de_DE.UTF-8, forcing to en_US.UTF-8
INFO: Desktop environment detected : xfce
INFO: Config directory is '/home/gerd/.config/asbru'
INFO: Used config file '/home/gerd/.config/asbru/asbru.nfreeze'
INFO: Virtual terminal emulator (VTE) version is 0.62
INFO: Theme directory is '/opt/asbru/res/themes/system'
INFO: Trying to loading Unity specific tray icon package...
WARNING: AppIndicator is missing --> there might be no icon showing up in the status bar when running Unity!
INFO: Using Gnome tray icon
*** unhandled exception in callback:
***   ERROR:Operation not permitted at /opt/asbru/lib/PACTerminal.pm line 223.
***  ignoring at /usr/lib/x86_64-linux-gnu/perl5/5.32/Glib/Object/Introspection.pm line 67.
^CINFO: Signal 'INT' received. Exiting Ásbrú... 

any Ideas to solve the problem or any Ideas to reach my aim?

regards

HI,
I do a third test drive:
In the asbru.yml I changed every paths from /home/myname/ to the environment variable /$HOME. Only this file asbru.yml stay in a share directory, the whole rest remains in the user /$HOME/.config/asbru ....
Only to the asbru.yml file I create a symbolic link (share directory to /$HOME/.config/asbru )
I remove the nfreeze files.
And now: It works! Yeahhh ... But only one time :-(
After closing the asbru session it overwrite the environment variable /$HOME with the absolute path, back to /home/myname/

Is it possible to change this behaviour?
regards,
liprox

seems duplicate of #828

Hi,
thanks for the reaction
I think this does not help ... #828 search for a solution for two asbru-cm profiles on the same machine, as I understand ..(?)
I’m looking for a solution for two or more PCs in a network and every worker can use the same one asbru.yml file.
We have a lot of connections for all persons and want to change or create it only one time :-)
Every test with variable $HOME and the write right until now without success ....
For now and as I understand is the behavior from asbru-cm to automatic change the $HOME variable to the absolute path with the user name is the main problem to solve this ...

Any Help or Ideas are welcome

love asbru since a long time, and also spend some money ... ;-)

Waw, thanks a lot ! Much appreciated.

my aim is to work with one other person together with the same asbru directory

Yes, this is a duplicate of #95 and is propably one of most "popular" feature requests :) Your commitment and energy to find a solution may give a great "push" to this, let's surf on this !

asbru-cm --config-dir=/srv/cd_fc/sys/test01/asbru/

This is how I would see this working but today, there is absolutely nothing foreseen to "share" that directory between several users. We will need to make somre changes but I don't know which ones exactly yet...Let's try to find this.

ERROR:Operation not permitted at /opt/asbru/lib/PACTerminal.pm line 223.

Mmm, strange, this happens when trying to create a socket. A few questions to understand your setup:

  • Do both users have read/write access to that directory?
  • Does that happen when you start the first or the second client?
  • Does that happen when you start the application or when you start a terminal?
  • Does that happen if you start a local terminal?

In the asbru.yml I changed every paths from /home/myname/ to the environment variable /$HOME

Why do you have $HOME ? You should have everything in the shared config-dir, shouldn't you ?

Don't have much time but this topic is really interesting and would be great feature to add to the project ! Let's try to understand this correctly and move forward to a workable solution as soon as we can.

Thanks again for your contributation and positive attitude :)

HI,

asbru-cm --config-dir=/srv/cd_fc/sys/test01/asbru/

This is how I would see this working but today, there is absolutely nothing foreseen to "share" that directory between several users. We will need to make somre changes but I don't know which ones exactly yet...Let's try to find this.

ERROR:Operation not permitted at /opt/asbru/lib/PACTerminal.pm line 223.

Mmm, strange, this happens when trying to create a socket. A few questions to understand your setup:

* Do both users have read/write access to that directory?

yes, both have write permissions

* Does that happen when you start the first or the second client?

the ERROR Line appears if I start the first time a terminal or connection with asbru-cm
EDIT: on the second PC (Arch Linux) we get the same error but not line 223 there we get ... PACTerminal.pm line 222.

INFO: Using Gnome tray icon
*** unhandled exception in callback:
***   ERROR:Operation not permitted at /opt/asbru/lib/PACTerminal.pm line 223.
***  ignoring at /usr/lib/x86_64-linux-gnu/perl5/5.32/Glib/Object/Introspection.pm line 67 
* Does that happen when you start the application or when you start a terminal?

for now I only try it with ssh connections = terminal
EDIT: with rdp I get the same error

* Does that happen if you start a local terminal?

If I click on the button "Local shell" I get the same ERROR

INFO: Using Gnome tray icon
 *** unhandled exception in callback: 
 ***   ERROR:Operation not permitted at /opt/asbru/lib/PACTerminal.pm line 223. 
 ***  ignoring at /usr/share/perl5/Gtk3.pm line 572.  

In the asbru.yml I changed every paths from /home/myname/ to the environment variable /$HOME
Why do you have $HOME ? You should have everything in the shared config-dir, shouldn't you ?

Yes. Now I start a new test try with an empty directory, only one asbru.yml
there is only one $HOME Path:
shell directory: /$HOME/

for using the right paths I changed the paths to this test directory:
/srv/cd_fc/sys/test01
( /srv/cd_fc is a samba4 share directory )

for example this ones to:
session logs folder: /srv/cd_fc/sys/test01/session_logs
and line number 2665 to 2669:

  log file: '/srv/cd_fc/sys/test01/tmp/asbru_PID{3772}_n2.txt'
  socket: '/srv/cd_fc/sys/test01/sockets/asbru_PID{3772}_n2.socket'
  socket exec: '/srv/cd_fc/sys/test01/sockets/asbru_PID{3772}_n2.exec.socket'
  tray available: warning

The directory's tmp, sockets are created by asbru-cm but no (socket-) files in it

Don't have much time but this topic is really interesting and would be great feature to add to the project ! Let's try to understand this correctly and move forward to a workable solution as soon as we can.

I Thank you, this is your work, and this is great!
regards,
gerd

ERROR:Operation not permitted at /opt/asbru/lib/PACTerminal.pm line 223. 

I've been able to reproduce this by mounting a Samba disk on which I have read-write access ... It must be related to the way the samba drive is mounted ; the system is unable to create a socket file on this system.

I'm searching the net to find information about this...

Let's keep posted!

I've been able to reproduce this outside Ásbrú:

This command just works fine:

$ nc -lU /tmp/my-socket 

But this fails:

$ nc -lU /mnt/smb-share/my-socket
nc: Operation not permitted

What nc -lU does is creating a "domain socket". Apparently, we cannot do that on a samba mounted drive. I did not find any documentation about this.

Maybe we should also create those sockets in the local /tmp directory of the Ásbrú client and avoid creating it in the config-dir ?

I'm continuing the investigations, any comment or suggestion will be warmly welcome.

I just pushed a change to the loki branch that should fix the "Operation not permitted" issue.

Ásbrú is now using a system temporary path for socket files instead of storing them into the config-dir.

By doing this, you should be able to have your config-dir as a smb/cifs shared folder.

Please let me know if this fixes the "Operation not permitted" issue.

I would suspect that there will be more glitches to fix if multiple users are accessing the same configuration file but please create new issues when you encouter them.

And thanks again for your great feedback.

You are the hero ! Thank You!
short answer: now it works
long answer:
I use the loki bullseye repository, after the update ther is version:

09:20root@lotte~# dpkg -l | grep asbru
ii  asbru-cm  6.4.0~1643846774-1 

And after the first test with my samba 4.11.17 share test environment:
asbru-cm --config-dir=/srv/cd_fc/sys/test01/
All the errors are gone. I test some ssh connections and one rdp connection to a windows server an it works like a charm
We will do more test in future, but I think that's it.
Thanks for your great work