Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/mruby-criu
CRIU, Checkpoint Restart In Userspace for Linux, bindig for mruby
https://github.com/matsumotory/mruby-criu
Last synced: about 2 months ago
JSON representation
CRIU, Checkpoint Restart In Userspace for Linux, bindig for mruby
- Host: GitHub
- URL: https://github.com/matsumotory/mruby-criu
- Owner: matsumotory
- License: other
- Created: 2014-04-13T11:31:07.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-12-12T01:02:24.000Z (about 5 years ago)
- Last Synced: 2024-10-18T18:26:32.469Z (3 months ago)
- Language: C
- Size: 19.5 KB
- Stars: 10
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mruby-criu
[CRIU, Checkpoint Restart In Userspace for Linux](http://criu.org/Main_Page), binding for mruby.
## install by mrbgems
- add conf.gem line to `build_config.rb````ruby
MRuby::Build.new do |conf|# ... (snip) ...
conf.gem :git => 'https://github.com/matsumoto-r/mruby-criu.git'
end
```
## Dump and Restore Process
### Isolated process run
##### loop.sh
```bash
#!/bin/bash
cont=0
while :; do
sleep 1
cont=`expr $cont + 1`
echo $cont
done
```
##### run
```bash
setsid ./loop.sh < /dev/null &> loop_log.txt &
```
##### get pid
```bash
ps -C loop.sh
PID TTY TIME CMD
4823 ? 00:00:00 loop.sh
[1]+ Done setsid ./loop.sh < /dev/null &>loop_log.txt
```
##### check log
```bash
tail -f loop_log.txt
1
2
3
...
```
### Dump(Checkpoint)
```ruby
socket = "/var/run/criu_service.socket"
images = "/tmp/dump_test"
log = "dump.log"
pid = 4823c = CRIU.new
c.set_pid pid
c.set_images_dir images
c.set_service_address socket
c.set_log_file logc.dump
```
##### dump loop.sh
```
./bin/mruby dump.rb
```
then, ``loop.sh`` was killed.
```bash
tail -f loop_log.txt
1
2
3(stopped)
```
### Restore
```ruby
socket = "/var/run/criu_service.socket"
images = "/tmp/dump_test"
log = "restore.log"c = CRIU.new
c.set_service_address socket
c.set_images_dir images
c.set_log_file logc.restore
```
##### restore loop.sh
```
./bin/mruby restore.rb
```
then, loop.sh was restored
```bash
tail -f loop_log.txt
(restored)
4
5
6
...
```
## License
under the MIT License:
- see LICENSE file