WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: what about custom onDemand rc files?  (Read 2847 times)

Offline FxIII

  • Newbie
  • *
  • Posts: 6
what about custom onDemand rc files?
« on: March 15, 2011, 08:16:40 AM »
I installed my Dropbear on demand and, as you know, is it possible to bring it up simply typing dropbear. But after a $ dropbear always come an $ sudo /etc/init.d/dropbear start.

I should change the script in my persistent tce/ondemand folder but you know this is not the better place to put the custom initialization.

What about to let each script that is loaded on demand to look for a directory in /opt so an user can write its custom command to execute after an extension is loaded on demand?

What about /opt/onDemanded/%extensionName%.rc ? If the file exists and is executable it is executed by the onDemand loading script; nothing happens otherwise.

Let me know what you think about it!
--Fabio

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10962
Re: what about custom onDemand rc files?
« Reply #1 on: March 15, 2011, 08:27:12 AM »
Quote
I should change the script in my persistent tce/ondemand folder but you know this is not the better place to put the custom initialization.

That's exactly the place ;)

In fact the earlier manual wizard for creating ondemand items used to ask which binary to run, if it couldn't determine one automatically from a menu item.
The only barriers that can stop you are the ones you create yourself.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: what about custom onDemand rc files?
« Reply #2 on: March 15, 2011, 08:27:47 AM »
I see several potential problems.
1. Some extensions provide more than one service. EX: nfsserver and nfsclient.
    The user may not wish to run them all.
2. Most servers require cusomized config files that will not be installed the first time the service is loaded.
    These config files also need to be saved.
3. The structure of an extension will need to be changed to account for the above requirements.

Offline FxIII

  • Newbie
  • *
  • Posts: 6
Re: what about custom onDemand rc files?
« Reply #3 on: March 15, 2011, 08:47:32 AM »
@gerald_clark
1. the user can write a script that brings up one of the service or both or ask the user or not write the rc file at all if is not the case (it should be an optional script and not just for setup )
2. in the script one can update the /opt/.filetool.lst to take this into account (i'm not sure i understood your point here)
3. cant the change be done when building the extension by using the relative /tce/ondemand/ script in an automatic way? (I didnt see yet how one  should build a new extension)

@curaga
arent those script generated somewhere? I mean: what appends if i remove an extension from the onDemand list? are my change to that file lost?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: what about custom onDemand rc files?
« Reply #4 on: March 15, 2011, 09:35:00 AM »
Of course the user can write scripts.
I put mine in ~/.local/bin
When I run ssh, and it is not found, it loads dropbear and passes the original options to ssh.

I thought you wanted automatic configuration.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10962
Re: what about custom onDemand rc files?
« Reply #5 on: March 15, 2011, 10:22:34 AM »
Quote
@curaga
arent those script generated somewhere? I mean: what appends if i remove an extension from the onDemand list? are my change to that file lost?

Yes, and yes. However, an ondemand script already usually starts one app, so creating an entirely new framework to do the same feels as an unnecessary complication to me.


If you feel you want to keep the script around even when moving things in appsaudit, just move it to some other dir (like ~/.local/bin), where it won't be affected.
« Last Edit: March 15, 2011, 10:24:44 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline FxIII

  • Newbie
  • *
  • Posts: 6
Re: what about custom onDemand rc files?
« Reply #6 on: March 16, 2011, 01:25:13 AM »
It make sense to move the optional startup script upstream. To make it possible the ~/.local/bin should be in the path before the [...]/tce/ondemand folder. My PATH env does not talk about any $HOME/.local/bin. Where is the better place to tell the shell to load that folder just before the [...]/tce/ondemand one? In that case one can just wrote down a script that runs the ondemand loading script and then put its own code to automatize any task can be usefull to do after start.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: what about custom onDemand rc files?
« Reply #7 on: March 16, 2011, 03:36:56 AM »
My PATH env does not talk about any $HOME/.local/bin.

Does the dir exist?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: what about custom onDemand rc files?
« Reply #8 on: March 16, 2011, 04:55:21 PM »
If ${HOME}/.local/bin exists (is a directory), .profile adds it to the PATH.

For myself, I use ${HOME}/bin - can't imagine why you'd want that hidden.

32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar